optimize-nginx

optimize-nginx is a command for Claude Code from armanzeroeight/fastagent-plugins. It costs 13 tokens per session (879 once invoked), scanned A, original, MIT.

A checklist and recommendation guide for improving nginx configuration. It examines performance settings, security, caching, compression, logging, and TLS.

In plain words
What is it for?
Use it to review an nginx configuration, identify settings to change, and produce concrete configuration snippets with priorities.
Why use it?
It helps uncover configuration problems that can slow a web server down, weaken its security, or make it harder to operate.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/armanzeroeight/fastagent-plugins/optimize-nginx
Clone the repo
git clone --depth 1 https://github.com/armanzeroeight/fastagent-plugins

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for optimize-nginx

README.md
[![agentmods](https://agentmods.dev/badge/commands/armanzeroeight/fastagent-plugins/optimize-nginx.svg)](https://agentmods.dev/commands/armanzeroeight/fastagent-plugins/optimize-nginx)
Your own site
<a href="https://agentmods.dev/commands/armanzeroeight/fastagent-plugins/optimize-nginx"><img src="https://agentmods.dev/badge/commands/armanzeroeight/fastagent-plugins/optimize-nginx.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 879 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.00879
Opus 5 $0.00006 $0.00439
Sonnet 5 $0.00003 $0.00176
Haiku 4.5 $0.00001 $0.00088

Measured 2d ago against content hash ef1c2c2ac024, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

optimize-nginx scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/nginx-toolkit/commands/optimize-nginx.md · 143 lines

How it starts

The opening of the file, as written. The whole thing — 143 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Optimize Nginx Configuration

Context

  • Current nginx version: !nginx -v 2>&1
  • Configuration test: !nginx -t 2>&1
  • Main config file: !nginx -V 2>&1 | grep -o 'conf-path=[^ ]*' | cut -d= -f2
  • Running processes: !ps aux | grep nginx | grep -v grep

Your Task

Analyze the nginx configuration and provide optimization recommendations for performance, security, and best practices.

Arguments

  • $1 (optional): Path to nginx configuration file to analyze (defaults to main config)

Steps

  1. Read and analyze configuration

    • If argument provided, read that file
    • Otherwise, read main nginx.conf
    • Identify current settings for workers, connections, timeouts, SSL, caching
  2. Check for common issues

    • Worker processes and connections
    • Buffer sizes
    • Timeout values
    • SSL/TLS configuration
    • Security headers
    • Gzip compression
    • Static file caching
    • Access and error log configuration
  3. Provide specific recommendations

    • List current settings that need improvement
    • Explain why each change is beneficial
    • Provide exact configuration snippets to add/modify
    • Prioritize by impact (high/medium/low)
  4. Generate optimized configuration

    • Create a suggested configuration file
    • Include comments explaining each optimization
    • Preserve existing custom configurations
    • Ensure backward compatibility
  5. Provide testing instructions

    • How to test the new configuration
    • How to reload nginx safely
    • How to rollback if needed

Example Usage

# Analyze main nginx configuration
/optimize-nginx

# Analyze specific configuration file
/optimize-nginx /etc/nginx/sites-available/example.com

# Analyze and apply optimizations
/optimize-nginx /etc/nginx/nginx.conf

Optimization Checklist

Performance:

  • Worker processes set to auto or CPU count
  • Worker connections optimized (typically 1024-4096)
  • Keepalive timeout configured (65s recommended)
  • Gzip compression enabled for text content
  • Static file caching with expires headers
  • Buffer sizes tuned for workload
  • Sendfile enabled for static files

Read the full file on GitHub · 143 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 143 lines · 13 tokens per session scan A ef1c2c2ac024

Subscribe to this mod's changes

optimize-nginx is a command published in the GitHub repository armanzeroeight/fastagent-plugins (29 stars, last pushed 1mo ago), licensed MIT. It adds 13 tokens to every session and 879 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.