agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/devops/nginx-config-generator/SKILL.md

nginx-config-generator

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Generates Nginx configurations for reverse proxying, load balancing, SSL termination, and static file serving. Use when configuring Nginx for a web server or API gateway.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Websockets: Add proxy_http_version 1.1.

    line 76
  2. Distinctive:

    Test rate limiting by sending many requests.

    line 85

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Overview

Produces hardened, production-ready Nginx server blocks for common use cases: reverse proxy to backend apps, load balancing across multiple upstreams, SSL termination with Let's Encrypt, static file serving with caching, gzip, rate limiting, and a full set of security headers (HSTS, CSP, X-Frame-Options, etc.).

When to Use This Skill

  • Setting up or replacing a reverse proxy / load balancer.
  • Configuring Nginx in front of Node.js, Python, Go, or other app servers.
  • Adding HTTPS or improving security headers.

Prerequisites

  • Nginx installed (or in Docker).
  • Domain name and ability to point DNS.
  • For Let's Encrypt: certbot or cert-manager.

Steps

  1. Basic server block structure:
    • listen 80 + redirect to HTTPS.
    • listen 443 ssl http2.
    • server_name.
    • Root or proxy_pass.
  2. Upstream definition for load balancing or multiple backends.
  3. SSL/TLS:
    • Modern cipher suite.
    • OCSP stapling.
    • Let's Encrypt paths (/etc/letsencrypt).
  4. Proxy settings:
    • proxy_pass http://backend;
    • proxy_set_header for X-Forwarded-*, Host, etc.
    • Timeouts and buffering.
  5. Performance:
    • gzip on.
    • Static file caching headers (immutable for hashed assets).
    • sendfile, tcp_nopush.
  6. Security headers (include a reusable snippet):
    • Strict-Transport-Security.
    • Content-Security-Policy (start restrictive).
    • X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy.
  7. Rate limiting:
    • limit_req_zone.
    • Different zones for login vs general.
  8. Output:
    • Complete /etc/nginx/sites-available/example.com.conf.
    • Symlink instructions.
    • nginx -t and reload commands.
    • certbot command for SSL.
    • Testing with curl -I.

Examples

A full reverse proxy config for a Next.js app on port 3000 with SSL, security headers, gzip, rate limiting, and static asset caching is included, plus a load-balanced upstream example.

Edge Cases & Error Handling

  • Websockets: Add proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; etc.
  • Large uploads: Increase client_max_body_size.
  • Maintenance mode: Provide a config snippet that returns 503 with a nice page.

Verification

  1. nginx -t — config is valid.
  2. curl -I https://example.com — correct headers, 200 or 301.
  3. curl -I https://example.com/_next/static/... — long cache headers.
  4. Test rate limiting by sending many requests.
  5. SSL Labs test (A+ rating target).
  6. Success: Traffic is proxied correctly, HTTPS works, headers are secure, performance features are active.

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.