Skip to main content

Nginx Reverse Proxy Config Generator

Generate a production-ready Nginx reverse proxy configuration for your backend app. Configure WebSocket support, SSL/TLS, CORS, rate limiting, cache headers, and security headers — then copy the result directly into your server.

✓ WebSocket + SSL/TLS ✓ CORS + Security headers ✓ Rate limiting + Gzip

Frequently Asked Questions

What is an Nginx reverse proxy and when do I need one?▼

A reverse proxy sits in front of your backend server (Node.js, Python, Go, etc.) and forwards client requests to it. You need one when: running multiple apps on one server (route by domain/path), adding SSL/TLS termination without modifying your app, hiding the backend port and implementation, adding rate limiting/security headers at the edge, or enabling WebSocket connections with proper upgrade headers.

How do I proxy a Node.js app on port 3000?▼

Set Upstream URL to http://127.0.0.1:3000 and Server Name to your domain. Nginx listens on port 80 (or 443 with SSL) and forwards all requests to your Node app. Add proxy_set_header X-Forwarded-For to make the real client IP available via req.headers['x-forwarded-for'] in your Node app. Also set proxy_buffering off for streaming/SSE responses.

How do I enable WebSocket support with Nginx?▼

WebSocket connections require the Upgrade header to be passed through. Check 'WebSocket Support' in this tool — it adds: proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; Without these, the WebSocket handshake fails with a 400 or 502 error. This works for socket.io, ws, and any WS-based protocol.

What is the proxy_read_timeout and when should I increase it?▼

proxy_read_timeout defines how long Nginx waits for a response from the upstream server before returning 504 Gateway Timeout. Default is 60s. Increase it for: long-running API endpoints, file uploads, AI inference, report generation, or any operation that takes more than a minute. Set it to the maximum expected response time plus a buffer. Never set it below your upstream's processing time.

How does CORS work at the Nginx level?▼

CORS (Cross-Origin Resource Sharing) headers tell browsers whether a cross-origin request is allowed. Nginx can add these headers before the response reaches the client. This is useful when your backend doesn't handle CORS itself or when you want to centralize CORS policy. The Access-Control-Allow-Origin header specifies which origins are allowed — use * for any origin or a specific domain for tighter security.

How do I add SSL/TLS to my Nginx proxy?▼

The easiest way is Let's Encrypt: install certbot, run 'sudo certbot --nginx -d yourdomain.com'. Certbot auto-configures SSL in your nginx.conf. Alternatively, enable SSL in this generator and provide your certificate paths. The config will add an HTTP→HTTPS redirect block, TLSv1.2/1.3, and modern cipher suites. After applying, run 'sudo nginx -t' then 'sudo systemctl reload nginx'.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Related Articles

Apr 2, 2026 · 11 min read

Nginx Configuration Guide for Web Developers 2026: Reverse Proxy, SSL & Performance

Master Nginx configuration in 2026. Complete guide covering reverse proxy setup, SSL/TLS with Let's Encrypt, gzip compression, caching, rate limiting, load balancing, and common gotchas.

Mar 27, 2026 · 13 min read

Nginx vs Caddy vs Traefik vs HAProxy: Web Server & Reverse Proxy Comparison 2025

A comprehensive comparison of Nginx, Caddy, Traefik, and HAProxy. Performance benchmarks, SSL/TLS handling, configuration syntax, Docker/K8s integration, and when to use each.

Mar 24, 2026 · 8 min read

Nginx Config Generator: Stop Writing Server Blocks by Hand

Learn how to use an Nginx config generator to create reverse proxies, SSL configs, load balancers, and virtual hosts instantly. Includes real examples and best practices.

Mar 28, 2026 · 18 min read

Complete Guide to HTTP Security Headers: CSP, HSTS, and Modern Browser Security 2026

Master HTTP security headers in 2026: Content-Security-Policy configuration, HSTS preloading, Permissions-Policy, COEP/COOP for cross-origin isolation, and real-world configs for nginx, Apache, and Next.js.

Apr 2, 2026 · 15 min read

DevOps Automation Tools in 2026: Orchestrating the Software Delivery Pipeline

Master DevOps automation with this guide to the tools that orchestrate modern software delivery. Covers CI/CD pipelines, infrastructure provisioning, configuration management, testing automation, and the emerging AI-assisted automation patterns that define 2026.

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →