What this builder gives you
If you have ever opened an empty `.conf` file under `/etc/nginx/sites-available/` and wondered where to even start, this tool is for you. It writes the whole server-block for the five things people actually do with nginx: serve a static site, put a reverse proxy in front of an app, run a clean redirect, host a subdomain, or spread traffic across many backends with a load balancer.
Pick a mode at the top, fill in a domain and a backend, flip the switches for SSL, gzip, WebSockets and Cloudflare. The right panel shows the exact text you paste into nginx, indented and styled like a real config. Copy or Download it as `<your-domain>.conf`.
Everything runs in your browser. No domains are resolved, no certs are issued, nothing is uploaded. The output is plain nginx syntax, identical to what you would type by hand if you had memorized every directive.
How to use it
- Pick a mode at the top: *Static site*, *Reverse proxy*, *Redirect*, *Subdomain* or *Load balancer*. Each mode shows only the fields that matter for it.
- Type your domains in server_name. One domain per line. The first one is used as the certificate name.
- Pick the listen port. 80 for plain HTTP, 443 for HTTPS, 8080 when an upstream proxy or Docker handles TLS.
- Flip Add SSL block to wire up Let's Encrypt paths (`/etc/letsencrypt/live/<domain>/fullchain.pem`). Leave Add HTTP to HTTPS redirect on so plain HTTP visitors are bounced to https with a `301`.
- For Reverse proxy: set proxy_pass to your backend, e.g. `http://127.0.0.1:3000`. Keep X-Forwarded- headers on so your app sees the real client IP.
- For Load balancer: paste one `address:port` per line in *Backend servers* and pick an algorithm. Use upstream groups with `least_conn` for slow apps and `ip_hash` when you need sticky sessions.
- If your app uses WebSockets (Socket.IO, Phoenix Channels, etc.) flip Add WebSocket Upgrade headers. If you front nginx with Cloudflare, flip Add Cloudflare real IP so logs show the real client.
- Click Copy, paste into `/etc/nginx/sites-available/<your-file>.conf`, symlink to `sites-enabled`, run `sudo nginx -t` to validate syntax, then `sudo systemctl reload nginx`.
When this is useful
Seven situations where a ready-made server-block saves a lot of squinting at docs:
- You deployed a Node, Python or Go app on a VPS and want to put it on port 443 with a proper TLS cert. Pick *Reverse proxy*, point at `http://127.0.0.1:3000`, flip SSL on, done. Nginx terminates TLS, your app stays plain HTTP behind it.
- You bought a domain for a static landing page. Pick *Static site*, point root at `/var/www/your-site` and you get a working server-block with the right index files and a try_files fallback.
- You are migrating an old domain to a new one. Pick *Redirect*, target `https://new.example.com$request_uri`, code `301`. Google updates the index, browsers cache the redirect, your old links keep working.
- You want a subdomain for a blog. Pick *Subdomain*, prefix `blog`, base `example.com` and you get a complete `blog.example.com` server-block. Save under that exact filename to keep `sites-available/` tidy.
- Your app cannot handle the load on one box. Pick *Load balancer*, paste three or four backend `address:port` lines, pick `least_conn` and nginx routes each request to the least busy one. Adding a server is one new line.
- Your real-time chat is broken behind nginx because of WebSockets. Flip *Add WebSocket Upgrade headers* and nginx forwards `Upgrade` and `Connection` properly, with a 24h read timeout that survives long-lived connections.
- You sit behind Cloudflare and all your logs say "172.x.x.x". Flip *Add Cloudflare real IP*, nginx rewrites `$remote_addr` from the `CF-Connecting-IP` header coming from Cloudflare ranges. Rate limits, fail2ban and audit logs work again.