Skip to content
Tooldict

Nginx Config Generator

Stop wrestling with server setups. Generate security- and performance-focused Nginx configurations for your web projects in seconds.

server {
    listen 80;
    server_name example.com;
    root /var/www/html;
    index index.html;
    gzip on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
    
    location / {
        try_files $uri $uri/ =404;
    }
    location ~* \.(jpg|jpeg|png|gif|ico|css|js|woff2)$ {
        expires 1y;
        add_header Cache-Control "public, immutable";
    }
}

About

Advanced settings include HTTP/2, Gzip compression, and SSL (Let's Encrypt compatible) configurations out of the box.

How to use

  1. 1. Enter your domain name.
  2. 2. Select the server type (Static site, Node.js proxy, PHP, etc.).
  3. 3. Toggle HTTPS/SSL usage and grab your code.

Frequently Asked Questions

Will the generated config work out of the box?
For most standard scenarios, yes. But you might need to slightly adjust file paths depending on your specific OS.

Other tools

Embed this tool

Copy the code below and paste it into your site's HTML to embed this tool for free. The snippet includes an attribution link back to the source.

<iframe src="https://tooldict.com/embed/en/nginx-config-generator" title="Nginx Config" width="100%" height="600" style="border:1px solid #e2e8f0;border-radius:16px;max-width:680px" loading="lazy"></iframe>
<p style="font:13px/1.5 sans-serif">Powered by <a href="https://tooldict.com/en/nginx-config-generator" target="_blank" rel="noopener">Nginx Config</a> โ€” Tooldict</p>