Nginx Config Generator
A form-driven builder for nginx server blocks. Pick reverse proxy, static, or PHP-FPM, add certificates and headers, and get a config you can paste straight into sites-available.
This nginx config generator writes a complete server block from a short form, so you don't have to remember the exact directive names and nesting. Choose how the site is served (reverse proxy to an upstream, static files from a document root, or PHP through FastCGI), then flip on TLS, gzip, HTTP/2 or security headers and watch the nginx.conf text update as you type. Turning on SSL adds the `listen 443 ssl` server plus a second server on port 80 that returns a 301 to HTTPS, and reverse-proxy mode drops in the `proxy_set_header` forwarding lines that trip people up. Copy the result into sites-available or download it as a .conf file.
How it works
- 1
Enter the domain and pick a site type
Type the server_name (one or several domains). Choose reverse proxy and give it an upstream like http://localhost:3000, or static with a document root, or PHP with a php-fpm socket.
- 2
Toggle TLS and the extras you need
Switch on SSL to get a 443 server with your ssl_certificate paths and an HTTP-to-HTTPS redirect. Add HTTP/2, gzip, a client_max_body_size, and the standard security headers with individual toggles.
- 3
Copy or download the server block
The config on the right rebuilds on every change. Copy it into /etc/nginx/sites-available, or download it as domain.conf, then run nginx -t and reload.
Instant & 100% private — nothing is uploaded
Everything runs locally in your browser. Your code, text and files are processed on your own device and are never sent to a server — so there are no upload waits, no size limits from us, and nothing is ever stored or logged.
Frequently asked questions
- How do I generate an nginx reverse proxy config with the right headers?
- Pick the reverse proxy site type and set the upstream, e.g. http://localhost:3000. The tool writes a location / block with proxy_pass plus proxy_set_header Host $host, X-Real-IP $remote_addr, X-Forwarded-For $proxy_add_x_forwarded_for and X-Forwarded-Proto $scheme. Leaving those headers out is the usual reason a proxied app sees the wrong client IP or scheme.
- What does a full nginx SSL server block look like?
- With SSL enabled for example.com the output is two servers. First a redirect: server { listen 80; server_name example.com; return 301 https://$host$request_uri; }. Then the real one: server { listen 443 ssl; http2 on; server_name example.com; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; location / { ... } }. Point the two ssl_ paths at your certificate and key.
- Can it generate a config for a PHP site with PHP-FPM?
- Yes. Choose the PHP / FastCGI type and set fastcgi_pass to your socket (unix:/run/php/php8.2-fpm.sock) or a host:port like 127.0.0.1:9000. You get a location ~ \.php$ block with include fastcgi_params and the SCRIPT_FILENAME fastcgi_param, plus a try_files rule that routes clean URLs through index.php.
- Where do I put the generated file and how do I load it?
- Save it as /etc/nginx/sites-available/example.com.conf, symlink it into sites-enabled (ln -s ../sites-available/example.com.conf /etc/nginx/sites-enabled/), then run sudo nginx -t to check the syntax and sudo systemctl reload nginx to apply it. Editing the listen port field changes the plain-HTTP port when TLS is off.
More tools
More from the Hivly network
Free sister tools on our other sites.