Nginx Reverse Proxy Config Builder

Configure reverse proxy upstream, WebSocket, SSL redirect, and security headers.

Feature & Hardening Modules
Generated Nginx Configuration
Embed this tool on your website / blog No code required · Copy and paste
HTML Embed Code (iframe):
<iframe src="https://lucentool.com/nginx-config-builder" width="100%" height="650" style="border:1px solid #e5e0d8;border-radius:12px;max-width:850px;width:100%;" frameborder="0"></iframe>
<div style="font-size:12px;color:#78716c;margin-top:6px;font-family:sans-serif;">Powered by <a href="https://lucentool.com/nginx-config-builder" target="_blank" style="color:#c85a32;text-decoration:none;">Lucentool - Nginx Reverse Proxy Config Builder</a></div>

Why X-Forwarded Headers are Essential

When Nginx proxies traffic to backend applications (Node.js, Go, Python), all connections appear to originate from 127.0.0.1. Omitting X-Real-IP and X-Forwarded-Proto blinds backend logs and security rate limiters to the client’s real IP address.

WebSocket Upgrade Mechanics

Standard HTTP/1.0 proxy directives drop hop-by-hop headers. Enabling WebSockets requires HTTP/1.1 and forwarding the Upgrade and Connection: "upgrade" headers to prevent immediate disconnection.

Formats, sizes and other limits

renderNginx() assembles a server block from the form: listen, root, server_name, an optional upstream with proxy_pass, a try_files fallback for single-page apps, a compression block, and location blocks for static assets. Two helpers fill in the security layer: securityHeaders(indent) writes X-Frame-Options, X-Content-Type-Options, Referrer-Policy and a content-security-policy placeholder, while corsHeaders(indent) writes the Access-Control-Allow-* family. Indentation is passed down so nested blocks stay readable, and the result is plain text you copy.

Where it stops working

Only the directives the form models are generated. Upstream load balancing, map blocks, if conditions, rate-limit zones, limit_req tuning and Lua hooks are outside its scope, and the TLS section emits a certificate path placeholder rather than a working certificate. Nothing here is validated against your nginx version, so a config that parses on 1.24 may still complain on an older build — always run nginx -t before a reload.

Privacy: nothing is uploaded

The domain, paths and header values you enter are concatenated into text locally; the builder never fetches your site, never resolves the hostname and keeps no copy of the config.

Frequently asked questions

Can I paste the output straight into production?

Treat it as a starting point: replace the placeholder paths and domain, run nginx -t, and reload rather than restart. The generated file has not seen your existing config.

Why is there no SSL certificate?

Certificates are issued, not generated by a form. The block gives you the ssl_certificate lines in the right place; obtaining the files is a job for certbot or your CA.

Does it configure HTTP/2?

It can add the http2 parameter to the listen directive. Whether that works depends on your nginx build — modern versions prefer a separate http2 directive.