Nginx Config Generator
Generate an Nginx server block for a static site or reverse proxy, with HTTPS redirect, gzip, WebSocket-ready proxy headers and SPA fallback. Free.
Generate Nginx config
Configure your server block. We build the Nginx config.
server {
listen 80;
server_name example.com www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
server_name example.com www.example.com;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
root /var/www/example.com;
index index.html;
location / {
try_files $uri $uri/ =404;
}
}
What this Nginx config generator does
Common use cases
- 1Deploying a static site
- 2Proxying a Node/Next app
- 3Adding HTTPS with Let's Encrypt
- 4Setting up a new server block
- 5Standardising server configs
- 6Learning Nginx syntax
Related tools
About Nginx configuration
Nginx serves sites and proxies apps using server blocks that define the domain, how requests are handled, and TLS. A typical setup redirects HTTP to HTTPS and either serves static files with a try_files fallback or proxies to an application upstream.
This generator produces a clean server block for either case, including the proxy headers needed for WebSockets and correct client IPs. After saving it, always run nginx -t to validate the syntax before reloading, and point the certificate paths at your actual certificates.
More Free Tools Where This Came From
This utility is one of dozens of free, no-login tools for DNS, email, SEO and developers — all instant and private.
HostCloud.in · Pune, India · Serving 34,987+ Websites Since 2020
Got Questions? We Have Answers.
What does it generate?
A complete server block for a static site (with try_files) or a reverse proxy (with the headers needed for WebSockets and correct client IPs), including an HTTP→HTTPS redirect.
How do I install it?
Save it to /etc/nginx/sites-available/, symlink to sites-enabled, run nginx -t to test, then reload Nginx.
Does it set up SSL?
It references Let's Encrypt certificate paths for the domain — adjust them to match your actual certificates.
Does it use AI or a server?
No. It builds the config in your browser.
