Runs 100% in your browser — nothing is uploaded
Generators

Nginx Config Generator

Generate a complete Nginx server block — SSL, reverse proxy, PHP-FPM, gzip, caching, and security headers.

Nginx Config Generator
Client-side

About this tool

The Nginx Config Generator builds a ready-to-use server {} block from a simple form, so you don't have to hand-copy boilerplate from old projects. Toggle the pieces you need — a static site root, PHP-FPM handling, SSL termination, a reverse proxy to a backend service, gzip compression, long-lived caching for static assets, baseline security headers, or rate limiting — and get syntactically correct, properly ordered directives instantly.

Each toggle produces the directives real production configs use: SSL blocks include a redirect from port 80 to 443 plus modern ssl_protocols and ssl_ciphers; the reverse proxy block sets the full set of X-Forwarded-* headers and WebSocket upgrade headers; static asset caching matches common JS/CSS/image extensions with a 30-day Cache-Control; security headers include X-Frame-Options, X-Content-Type-Options, a CSP placeholder, and Strict-Transport-Security when SSL is enabled. Because limit_req_zone must live in the http{} context rather than server{}, the generator adds a clearly commented snippet showing exactly where that line belongs, rather than silently producing a config that fails to reload.

Everything runs as pure string templating in your browser — no data is sent anywhere. Use Copy to grab the config, or Download to save it directly as nginx.conf. This is a fast starting point for a real deployment, not a substitute for testing with nginx -t before reloading a production server.

FAQ

Why is my limit_req_zone line in a comment instead of the server block?
limit_req_zone must be declared once in the http{} context, not inside a server{} block. Nginx will fail to reload if it finds limit_req_zone inside server{}. The generator adds the correct directive as a clearly marked comment so you can paste it into the right place.
Does this tool validate my config against a real Nginx parser?
No. It generates syntactically correct directives based on the options you choose, but does not run an actual Nginx parser. Always run nginx -t before reloading a production server.
Can I use this for both a static site and a reverse proxy at the same time?
The generator produces one location / block, either try_files for static serving or proxy_pass for reverse proxying. If you need both, generate the config, then manually add a second location block for the other case.
What SSL certificate paths should I use?
Enter the absolute paths to your certificate and private key files, e.g. paths issued by Let's Encrypt. This tool does not issue or validate certificates — it only wires the paths into the ssl_certificate directives.
Why does enabling SSL add a second server block?
The generator adds a small HTTP server block that only returns a redirect to HTTPS, plus your main server block listening on 443 — the standard pattern for forcing all traffic to HTTPS.