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.
THE TOOLBOX / DEVOPS & INFRASTRUCTURE
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.
sudo ln -sf /etc/nginx/sites-available/app.example.com.conf /etc/nginx/sites-enabled/ && sudo nginx -t && sudo systemctl reload nginxDEPLOYMENT CHECKLIST
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.
Restricting ssl_protocols to TLSv1.2 TLSv1.3 disables legacy ciphers while keeping compatibility with modern browsers and API clients.
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.
Always validate with sudo nginx -t before reloading. Pair your config with our CSP & Security Headers builder and X.509 Certificate Decoder.
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;`.
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.
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.
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/`.
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.