Loading...

About the Nginx Config Builder

Nginx server blocks accumulate the same hard-won boilerplate everywhere: TLS settings that pass modern scanners, proxy headers that preserve client identity, websocket upgrade handling, gzip, and security headers. This builder generates server block configurations from structured choices, with the directives that are easy to forget and painful to debug when missing.

The proxy header block is the classic example — omit X-Forwarded-For and your application logs the proxy's IP for every client; omit the Upgrade/Connection pair and websockets fail with errors that point everywhere except the config.

Frequently asked questions

Which proxy headers must a reverse proxy set?

proxy_set_header Host $host (so the upstream sees the real hostname), X-Real-IP and X-Forwarded-For $proxy_add_x_forwarded_for (client identity), and X-Forwarded-Proto $scheme (so the app knows the original request was HTTPS and doesn't redirect-loop). For websockets add Upgrade $http_upgrade and Connection "upgrade" with proxy_http_version 1.1.

Why does nginx return 413 Request Entity Too Large?

client_max_body_size defaults to 1MB — any larger upload is rejected before reaching your application. Set it in the server or location block to match your real upload limits. Remember the application server (and any other proxy in the chain) has its own limit; the effective maximum is the smallest of them.

How should I redirect HTTP to HTTPS correctly?

A dedicated port-80 server block: return 301 https://$host$request_uri; — using $host (not a hardcoded domain) preserves subdomains, and $request_uri keeps path and query intact. Keep the ACME challenge location reachable over HTTP if you use HTTP-01 renewal, and add HSTS only once you are confident HTTPS is permanent.

Need this managed for you, not just automated?

We're also a hands-on DevOps consultancy — Kubernetes, CI/CD, and cloud infrastructure.

Explore Our Services