Nginx Config Generator
Generate production-ready Nginx configurations with SSL, proxy, caching, and security headers.
Free & unlimited
Quick presets
Server
Domain name
Listen port
Root directory
SSL / TLS
Reverse proxy
Static files & compression
Static file location
Security & limits
Max body size
Preview
# Generated by ToolChamp Nginx config generatorserver { listen 80; server_name example.com; root /var/www/html; index index.html index.htm; server_tokens off; # Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; client_max_body_size 10m; # Gzip compression gzip on; gzip_min_length 1000; gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml; location / { try_files $uri $uri/ /index.html; } location /static/ { alias /var/www/html/static/; expires 30d; add_header Cache-Control "public, immutable"; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log;}All processing happens in your browser. No data is sent to any server.
About this tool
- 1
Set server basics
Enter your domain name, port, and root directory.
- 2
Configure features
Enable SSL, reverse proxy, gzip, security headers, and more.
- 3
Add locations
Define custom location blocks and redirects.
- 4
Copy config
Copy the generated nginx configuration or download as a file.
- Use presets like "Node.js app" or "React SPA" to get a working config instantly.
- Always enable HTTPS redirect and HSTS for production sites.
- The config includes comments explaining each directive.
- SSL/TLS configuration
- Reverse proxy setup
- Gzip compression
- Security headers
- Custom locations
- Presets
- Syntax-highlighted output
- Setting up nginx for a new web application
- Configuring a reverse proxy for Node.js or Python apps
- Generating secure nginx configs with best practices