Skip to content
Back to skills

Nginx Config

ASecurity

Write or optimize an nginx config for a reverse proxy or static site

  • 3 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 3, 2026
ai-agentsgobackendsecurityperformance

Works with

  • cli

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add black141312/ada --skill nginx-config --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Nginx Config?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Nginx Config
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/black141312-nginx-config/badge)](https://www.skillsdirectory.com/skills/black141312-nginx-config)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: nginx-config
description: Write or optimize an nginx config for a reverse proxy or static site
category: cloud
---

# Nginx Config

Reach for this when configuring nginx as a reverse proxy, static file server, or TLS terminator — and when tightening an existing config for performance or security.

1. Define one `server` block per virtual host with `server_name` and the correct `listen` (80 and 443).
2. For proxying, set `proxy_pass` plus the standard forwarded headers (`Host`, `X-Real-IP`, `X-Forwarded-For`, `X-Forwarded-Proto`).
3. For TLS, point `ssl_certificate`/`ssl_certificate_key` at the certs and redirect `:80` to `:443`.
4. Enable `gzip` (or brotli) and set cache headers / `expires` for static assets.
5. Add security headers (`Strict-Transport-Security`, `X-Content-Type-Options`, `X-Frame-Options`) and hide `server_tokens off`.
6. Test with `nginx -t`, then reload with `nginx -s reload` — never a hard restart for a config change.

## Rules
- Always `nginx -t` before reloading; a syntax error on restart takes the site down.
- Set `client_max_body_size` to match real upload needs — the 1MB default silently rejects larger requests.
- Tune `proxy_read_timeout`/`proxy_connect_timeout` for slow upstreams instead of leaving defaults.
- Don't terminate TLS with weak protocols; set `ssl_protocols TLSv1.2 TLSv1.3` and a modern cipher list.
- Use `upstream` blocks with health-aware load balancing rather than hardcoding a single backend when you have several.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.