Skip to content

Nginx Config Generator

Embed

Paste this where you want Nginx Config Generator on your site. Adjust the height to fit.

<iframe src="https://www.browserutils.dev/embed/nginx-config-generator/" width="100%" height="500" frameborder="0" loading="lazy" title="Nginx Config Generator"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://www.browserutils.dev/tools/nginx-config-generator/">Nginx Config Generator</a> by BrowserUtils</p>

Generate nginx server block configuration.Runs in this tab.

gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript;
gzip_min_length 256;

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
        proxy_cache_bypass $http_upgrade;
    }
}

Next step

About Nginx Config Generator

Free online Nginx configuration generator. Create nginx server blocks for reverse proxy, static file serving, and SSL termination with gzip compression. It runs in your browser. Nothing is sent to a server.

Questions

What is an Nginx server block?
A server block (also called a virtual host) is a configuration block in Nginx that defines how to handle requests for a specific domain or IP. It specifies the listen port, server name, root directory, and proxy settings.
How do I set up Nginx as a reverse proxy?
Use the proxy_pass directive to forward requests to a backend server. This generator lets you specify the upstream URL, and it generates the proper proxy headers (X-Real-IP, X-Forwarded-For, X-Forwarded-Proto) automatically.
How do I enable SSL/TLS in Nginx?
Toggle the SSL option in this generator to produce a configuration with listen 443 ssl, certificate paths, and recommended security headers. You will need to provide your own SSL certificate and key files on the server.
How do I enable gzip compression in Nginx?
This generator includes a gzip configuration section that compresses text-based responses (HTML, CSS, JS, JSON). Gzip typically reduces transfer sizes by 60-80%, improving page load times without any client-side changes.
Is the generated Nginx config safe to use in production?
The configuration follows common security best practices including security headers and SSL settings. Always test in a staging environment first, and adjust worker processes, buffer sizes, and rate limiting for your traffic volume.

More in DevOps & Config

All 16 devops & config