How the Nginx Reverse Proxy Config Generator Works
A short guide to the generated server block and how to use it.
What you get
The Nginx config generator outputs a single server block that:
- Listens on port 80 (HTTP) for IPv4 and IPv6
- Uses your domain(s) as
server_name - Proxies requests to your app running on a local port
- Supports WebSocket upgrades (e.g. for hot reload or real-time features)
- Hides dotfiles (e.g.
.env) from public access
Step-by-step usage
- Enter your domain (e.g.
example.com www.example.com) and the port where your app runs (e.g. 3000). - Click "Generate config" and copy the generated block.
- Save it to a file under
/etc/nginx/sites-available/(e.g.example.com) and create a symlink insites-enabled, or include it in your mainnginx.conf. - Run
nginx -tto test, then reload Nginx (e.g.systemctl reload nginx).
Best practices
- Use HTTPS in production: put the block inside a redirect from HTTP to HTTPS, or use a tool like Certbot to add SSL and get a matching
listen 443 sslblock. - Keep one server block per site or app to avoid duplication and make updates easier.
- Restrict the port range if you use the random port button (e.g. 3000–9999); ensure only your app listens on that port.