Nginx Config Generator
Generate an nginx server config online — static site, SPA fallback or reverse proxy with SSL, gzip, CORS and caching. Free, no signup.
Serving mode
Canonical host
nginx config — save to /etc/nginx/sites-available/
# example.com — nginx site config
# Redirect HTTP → HTTPS
server {
listen 80;
server_name example.com;
return 301 https://example.com$request_uri;
}
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;
gzip on;
gzip_comp_level 5;
gzip_min_length 1024;
gzip_vary on;
gzip_types text/plain text/css application/json application/javascript image/svg+xml;
client_max_body_size 10m;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
About Nginx Config Generator
Pick a serving mode — static site, SPA fallback or reverse proxy — and get a complete nginx server block: TLS with Let's Encrypt paths plus an HTTP→HTTPS redirect, a www⇄non-www canonical host block, gzip, CORS headers with an OPTIONS short-circuit, static-asset caching and client_max_body_size.
The output goes to /etc/nginx/sites-available/ as-is: sane proxy headers (Host, X-Forwarded-*), WebSocket upgrade support and HTTP/2 are built in. Everything generates in your browser — nothing is sent anywhere.