Nginx Reverse Proxy & WebSocket Builder
Choose an application runtime or Docker architecture below. Each preset generates a complete server block with Certbot SSL, WebSocket upgrade headers, and URI rewrite previews.
All 10 Nginx Reverse Proxy Architectures
10 static guidesNginx Reverse Proxy Config for Next.js SSR (App Router, SSL & Streaming)
Generate a production Nginx reverse proxy for Next.js App Router on port 3000 with Certbot SSL, _next/static caching, streaming responses, and WebSockets.
Nginx Reverse Proxy Config for FastAPI + Uvicorn (SSL, Docs & Timeouts)
Build a hardened Nginx reverse proxy config for Python FastAPI and Uvicorn/Gunicorn on port 8000 with --proxy-headers, SSL, WebSockets, and long timeouts.
Nginx Reverse Proxy Config for Laravel Octane & Reverb WebSockets
Configure Nginx reverse proxy for Laravel Octane (FrankenPHP/Swoole) on port 8000 and Laravel Reverb WebSockets on port 8080 with SSL and 3600s timeouts.
Nginx Reverse Proxy Config for Node.js Express & PM2 (trust proxy & SSL)
Generate a production Nginx reverse proxy for Node.js Express and PM2 on port 4000 with trust proxy, real client IP headers, Certbot SSL, and rate-limit safety.
Nginx Reverse Proxy Config for Socket.IO & WebSockets (Upgrade & 3600s)
Fix WebSocket 400 errors and 60-second disconnects in Nginx for Socket.IO and ws servers. Generate Upgrade, Connection map, and 3600s proxy_read_timeout blocks.
Nginx Reverse Proxy for Docker Compose Services (127.0.0.11 DNS Resolver)
Prevent 502 Bad Gateway and Nginx startup crashes in Docker Compose using resolver 127.0.0.11 and variable proxy_pass for dynamic container restarts.
Nginx Reverse Proxy Config for Django + Gunicorn (SSL, Static & CSRF)
Generate a production Nginx reverse proxy for Django and Gunicorn on port 8000 with SECURE_PROXY_SSL_HEADER, CSRF_TRUSTED_ORIGINS, /static/, and /media/.
Nginx Reverse Proxy Config for ASP.NET Core Kestrel (Forwarded Headers & SignalR)
Build a production Nginx reverse proxy for ASP.NET Core 8/9 Kestrel on port 5000 with UseForwardedHeaders, SignalR WebSockets, SSL, and large OAuth headers.
Nginx Config for React (Vite) SPA + Same-Origin /api/ Proxy (Zero CORS)
Serve a built React Vite dist/ SPA at / with try_files history fallback while proxying /api/ to your backend on the same Nginx domain to eliminate CORS.
Nginx Multi-Service Subpath Routing Config (/api/, /auth/ & /ws/)
Route /api/, /auth/, and /ws/ microservices to separate backend ports under one Nginx HTTPS domain. Master trailing-slash prefix stripping and prevent 404s.
Critical Nginx Reverse Proxy Rules Checked by OpsCheck
Debugging browser CORS too? Open CORS Simulator →1. Trailing Slash URI Rewriting
Adding a trailing slash to proxy_pass http://host:port/; strips the matched location prefix (/api/users → /users), whereas omitting it preserves the full path.
2. Docker DNS Stale-IP Prevention
Static container hostnames cache once at boot and cause 502 Bad Gateway after restarts. Pair resolver 127.0.0.11 with a variable-based proxy_pass $upstream_endpoint.
3. WebSocket Upgrades & Timeouts
Real-time sockets require proxy_http_version 1.1, the $connection_upgrade map, and extended proxy_read_timeout (e.g., 3600s) to prevent 60-second drops.