Generate an Nginx configuration for your site. Enter the domain, choose whether Nginx proxies to an app, serves static files, hosts a single-page app or runs PHP, and switch on HTTPS with an automatic redirect, Let's Encrypt certificate paths, HTTP/2, gzip, static caching, security headers and WebSocket support. Download the server block and drop it into sites-available. It's free, runs in your browser, and nothing is sent anywhere.
| Mode | Key directive |
|---|---|
| Reverse proxy | proxy_pass http://127.0.0.1:3000; |
| Static site | try_files $uri $uri/ =404; |
| Single-page app | try_files $uri $uri/ /index.html; |
| PHP | fastcgi_pass unix:/run/php/php8.3-fpm.sock; |
Add a server on port 80 that returns 301 https://yourdomain$request_uri. The generated config includes it, plus the path certbot needs.
Routes like /dashboard don't exist as files; falling back to index.html lets the JavaScript router handle them instead of returning 404.
Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto, so the app knows the original host, client IP and whether the request was HTTPS.
Once HTTPS works everywhere, yes — but browsers will refuse HTTP for a year, so make sure every subdomain has a certificate first.
Save it in /etc/nginx/sites-available/, link it into sites-enabled, run nginx -t, then reload Nginx.
No. The config is generated in your browser.
The generator writes complete server blocks rather than fragments. With HTTPS on, a port-80 server answers Let's Encrypt HTTP-01 challenges from a webroot and redirects everything else with a 301 to the canonical HTTPS host, preserving the path and query; the main server listens on 443 for IPv4 and IPv6 with the certificate paths certbot creates, TLS 1.2 and 1.3 only, and a session cache, with HTTP/2 enabled through the current http2 directive. The www choice adds a separate server that redirects the non-canonical hostname. As a reverse proxy it forwards Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto so the application sees the real client and scheme, and can add the Upgrade and Connection headers WebSockets need. Static sites use try_files with a 404, single-page apps fall back to index.html, and PHP passes scripts to PHP-FPM with SCRIPT_FILENAME set from $realpath_root and denies dotfiles. Optional blocks add gzip for text types, long-lived immutable caching for static assets, an upload size limit and security headers, with HSTS only offered once HTTPS is on. Every combination is tested to produce balanced braces.