Guide

THE TOOLBOX / DEVOPS & INFRASTRUCTURE

Generate Nginx configs
ready for production.

Build clean Nginx server blocks for reverse proxies, static SPAs, and PHP-FPM with Let's Encrypt HTTPS, HTTP/2, WebSocket Upgrade headers, gzip, security headers, and IP rate limiting.

Presets:
app.example.com.conf
sudo ln -sf /etc/nginx/sites-available/app.example.com.conf /etc/nginx/sites-enabled/ && sudo nginx -t && sudo systemctl reload nginx

DEPLOYMENT CHECKLIST

Best practices for Nginx reverse proxies and TLS termination.

1. Forwarded Client Headers

When terminating TLS at Nginx, always forward Host, X-Real-IP, X-Forwarded-For, and X-Forwarded-Proto so your upstream app generates correct HTTPS redirects and logs real visitor IPs.

2. Modern TLS & HSTS

Restricting ssl_protocols to TLSv1.2 TLSv1.3 disables legacy ciphers while keeping compatibility with modern browsers and API clients.

3. Safe Rate Limiting

Enabling limit_req_zone with a burst window absorbs brief parallel asset or API bursts from legitimate users while throttling credential stuffing and aggressive scrapers.

Frequently Asked Questions

Why does the generated config use `http2 on;` instead of `listen 443 ssl http2;`?

Nginx 1.25.1 deprecated the `http2` parameter on the `listen` directive in favor of the standalone `http2 on;` directive. If you run an older Nginx 1.18–1.24 release, replace `http2 on;` with `listen 443 ssl http2;`.

How do WebSocket connections work through an Nginx reverse proxy?

WebSockets require HTTP/1.1 (`proxy_http_version 1.1;`) plus forwarding the `Upgrade` and `Connection "upgrade"` headers so Nginx hands off the persistent TCP tunnel to your Node.js, Go, or Python backend.

How should I safely test and apply a new Nginx server block?

Save the file in `/etc/nginx/sites-available/`, symlink it into `/etc/nginx/sites-enabled/`, run `sudo nginx -t` to validate syntax before touching live traffic, and then run `sudo systemctl reload nginx` for a zero-downtime reload.

Why does the dotfile location rule allow `.well-known`?

Blocking `location ~ /\.(?!well-known).*` prevents accidental exposure of `.env`, `.git`, or `.htaccess` files while still allowing Let’s Encrypt ACME HTTP-01 challenges under `/.well-known/acme-challenge/`.

Does this generator support Static SPAs like React, Vite, or Vue?

Yes. Switch to the Static SPA tab to generate `try_files $uri $uri/ /index.html;` client-side routing fallback along with 30-day immutable caching for hashed JS/CSS/font assets.