Nginx Config Generator

Generate nginx server blocks for reverse proxy, static sites, SSL, load balancing, and WebSockets.

Proxy HTTP traffic to a backend origin.

Server settings
nginx.conf snippet
# Reverse proxy — app.example.com
server {
    listen 80;
    listen [::]:80;
    server_name app.example.com;
    client_max_body_size 10m;
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
    gzip_min_length 256;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_read_timeout 60s;
    }

    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;
    add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
}

About the Nginx Config Generator

The Nginx Config Generator produces ready to paste server blocks for common deployment patterns: reverse proxy to an app backend, static file hosting, TLS termination with certificate paths, HTTP to HTTPS redirects, upstream load balancing, and WebSocket upgrade proxying.

Fill in your domain, ports, upstream URL or backend pool, document root, and optional TLS paths. Toggle gzip and security headers when you want a hardened baseline. Output updates live as you edit.

Generated configs are starting points. Review paths, interface names in iptables PostUp rules on peer tools, and certificate locations before reloading nginx. Everything runs locally in your browser.

For live HTTP response headers on an origin, use HTTP Header Checker. For TLS on a public hostname, use SSL Checker after you deploy.

Your ad could be here

Reach developers and designers who use these tools every day. Privacy-first, no trackers.

Frequently asked questions

Where do I put the generated config?

Save as a file under /etc/nginx/sites-available/, symlink to sites-enabled, then run nginx -t and systemctl reload nginx. Exact paths vary by distribution.

Does this configure Let's Encrypt automatically?

No. SSL templates include placeholder certificate paths typical of certbot. Obtain certificates with certbot or your CA, then update ssl_certificate and ssl_certificate_key.

What upstream URL format should I use?

Include the scheme and host, for example http://127.0.0.1:3000 for a local Node app or http://backend:8080 in Docker Compose.

Is my config uploaded?

No. Assembly happens entirely in your browser.

Can I combine multiple templates?

Each run produces one pattern. Copy multiple blocks into the same file if you need redirect plus SSL plus WebSocket paths on one host.