Skip to content
100% local

NGINX config generator

Builds a complete NGINX server block from your domain, TLS, proxy, caching and security-header options.

Output

NGINX config generator

Set the options for the site you're deploying and this tool assembles a ready-to-use NGINX server block: the domain and any aliases, the document root, whether to listen on port 443 with HTTP/2 and redirect plain HTTP to it, and where the certificate and private key live. Turn on reverse proxying to send traffic to an upstream app server — the generated location block forwards Host, X-Real-IP and X-Forwarded-For/-Proto so the app sees the real client address behind the proxy — or serve static files directly with cache headers and an expiration for assets like CSS, JS and images.

Toggle gzip and Brotli compression, a single-page-app fallback that rewrites unknown paths to index.html, and a security-headers block that adds HSTS, X-Content-Type-Options and a Referrer-Policy. Blocking access to hidden files (.env, .git) and setting a custom 404 page, a request body size limit, and access/error log paths round out a config that covers the directives most sites actually need, in the order NGINX expects them. Enabling both the HTTPS redirect and the 443 listener produces two server blocks — one redirecting, one serving — exactly as NGINX requires.

The output is plain NGINX config syntax, ready to drop into a site file under /etc/nginx/sites-available/ or wherever your setup keeps them. Every option maps to real directives — there's no placeholder text left for you to hunt down and replace, beyond swapping in your own domain, upstream address and certificate paths if you haven't already typed them in.

Everything runs locally in your browser: the domain, paths and upstream address you type are used only to build the text you see and are never sent anywhere. Copy the result, download it as a .txt file, or send it back into the input to keep refining it.

FAQ

Does this tool upload my domain or server details anywhere?
No. The config is assembled entirely in your browser with JavaScript. Nothing you type — domain, paths, certificate locations, upstream address — is sent to a server.
Why do I get two server blocks instead of one?
When both 'Listen on 443 with HTTP/2' and 'Redirect HTTP to HTTPS' are on, NGINX needs a separate block on port 80 that only redirects, plus the main block on 443 that serves the site — a single block can't do both.
Can I use this for a reverse proxy in front of Node, Python or another backend?
Yes. Turn on "Reverse proxy to an upstream" and set the upstream address (host:port). The generated location block forwards the client IP and protocol via X-Real-IP, X-Forwarded-For and X-Forwarded-Proto.
Does the Brotli option require anything extra on the server?
Yes — Brotli support is not built into stock NGINX. The generated directives assume the ngx_brotli module is compiled in or loaded dynamically; the output includes a comment noting that.
Will the generated config work as-is, or do I need to edit it?
It's a complete, syntactically valid server block for the options you chose. You'll typically still want to double-check the certificate and key paths against where your TLS files actually live before deploying.