Works with the AI Agents you already use
Nginx Config Security and Performance Review
by Saizul Amin
Audit Nginx configurations for security vulnerabilities, header inheritance traps, and path traversal risks.
$6
Nginx Config Security and Performance Review
Example session with this skill installed
Review my nginx.conf for security and performance issues and tell me exactly what to change.
- Read your context and instructions
- Compiled the nginx config security
I ran the bundled script from the nginx-config-review skill and reviewed its findings.
Demo data: this is the real, unedited output of the skill's script on the test fixture that ships with its source repo.
Script output
[HIGH ] tests/fixtures/nginx-config-review/bad/nginx.conf:6 example.com: legacy TLS protocols enabled: TLSv1 TLSv1.1
fix: ssl_protocols TLSv1.2 TLSv1.3;
[HIGH ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:14 example.com: location /static without trailing slash uses alias /var/www/static/ (path traversal: /static../)
fix: location /static/ { alias /var/www/static/; }
[HIGH ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:23 example.com: proxy_pass $scheme://$http_host$request_uri takes the upstream host from the request (open proxy / SSRF)
fix: Proxy to a fixed upstream or validate the host against a map
[MEDIUM] tests/fixtures/nginx-config-review/bad/nginx.conf:7 example.com: ssl_ciphers allows weak algorithms: 3DES, RC4
fix: Use the Mozilla 'intermediate' cipher list (ssl-config.mozilla.org)
[MEDIUM] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:6 example.com: no Strict-Transport-Security header
fix: add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
[MEDIUM] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:15 example.com: autoindex on lists directory contents
fix: autoindex off; # or remove it
[MEDIUM] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:17 example.com: location /api/ has add_header, so it drops inherited headers: x-content-type-options
fix: Repeat the security headers in this location (or use an include snippet)
[LOW ] tests/fixtures/nginx-config-review/bad/nginx.conf:4 server_tokens is not off (nginx version shown in headers and error pages)
fix: server_tokens off; # in the http block
[LOW ] tests/fixtures/nginx-config-review/bad/nginx.conf:8 example.com: add_header X-Content-Type-Options has no 'always' (missing on 4xx/5xx)
fix: Append 'always' to the add_header directive
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:1 example.com: missing referrer-policy header
fix: add_header Referrer-Policy "strict-origin-when-cross-origin" always;
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:1 example.com: no clickjacking protection (X-Frame-Options or frame-ancestors)
fix: add_header X-Frame-Options "SAMEORIGIN" always; # or CSP frame-ancestors
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:1 example.com: no location denies hidden files (.git, .env)
fix: location ~ /\.(?!well-known) { deny all; }
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:1 HTTP server for example.com serves content instead of redirecting to HTTPS
fix: return 301 https://$host$request_uri;
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:6 example.com: missing referrer-policy header
fix: add_header Referrer-Policy "strict-origin-when-cross-origin" always;
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:6 example.com: no clickjacking protection (X-Frame-Options or frame-ancestors)
fix: add_header X-Frame-Options "SAMEORIGIN" always; # or CSP frame-ancestors
[LOW ] tests/fixtures/nginx-config-review/bad/sites-enabled/example.conf:6 example.com: no location denies hidden files (.git, .env)
fix: location ~ /\.(?!well-known) { deny all; }
Summary: 3 high, 4 medium, 9 low, 0 info. Test changes with `sudo nginx -t` before `sudo systemctl reload nginx`.
Next steps
- Fix HIGH items, then run nginx -t before reloading.
- Add the missing security headers and TLS settings.
- Re-run the review on the full nginx -T dump after changes.
Connects securely to your tools. The creator never sees your data.
About this skill
Nginx configurations often harbor silent security flaws like the add_header inheritance trap or alias path traversal. This skill audits your configuration files for security vulnerabilities and logical errors before you deploy them to production.
What it does
- Security auditing identifies missing HSTS headers, exposed
.gitor.envfiles, and weak TLS protocols. - Inheritance checking detects when
add_headerdirectives in alocationblock accidentally wipe out headers defined at theserverlevel. - Path traversal detection flags unsafe
aliasconfigurations that allow unauthorized filesystem access. - Syntax parsing follows
includedirectives or processesnginx -Tdumps to build a complete map of the effective configuration. - Proxy validation reviews reverse proxy settings for WebSockets,
X-Forwarded-Forheaders, and upstream timeouts.
How it works
- Source the config by reading local files or a full
nginx -Toutput dump to ensure all includes are resolved. - Execute the linter using
nginx_lint.pyto categorize findings by severity from low to high. - Manual verification checks for context-specific logic like rate limiting (
limit_req) andclient_max_body_sizefor uploads. - Remediation provides specific code snippets and a patch to fix identified vulnerabilities.
Frameworks & tools
Built for Nginx environments. Uses a Python-based parser (Python 3.8+) to analyze nginx.conf, sites-available, and conf.d files.
Why this beats prompting it yourself
Standard LLMs often miss the nuanced "inheritance trap" where adding one header deletes all others from parent blocks. This skill uses a dedicated parser and a curated checklist to catch specific Nginx edge cases that generic prompts overlook.
Use cases
- Hardening a new reverse proxy setup for a Node.js or Python application.
- Auditing existing production configs for legacy TLS ciphers and open proxies.
- Debugging missing security headers on specific API endpoints.
- Verifying configuration integrity before running a production reload.
Known limitations
Does not support Apache, Caddy, or HAProxy. It identifies configuration errors but does not perform live SSL certificate validation or log analysis.
Open source: saizul/vps-devops-skills on GitHub (MIT licence, by Saizul Amin).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Security.
Does not support Apache, Caddy, or HAProxy. Does not perform live SSL certificate validation or access log analysis. Nginx is required only for final syntax validation.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 2 days ago
- Software
Python 3.8+
Permissions
Allowed Hosts