Nginx Config Generator
Generate pre-configured nginx.conf settings for production ready Reverse Proxy, SSL/HTTPS, Load Balancer, static files and Single Page App. Includes rate limiting, caching, gzip and security headers. No installation required.
Tipo di Configurazione
Impostazioni Server
Server Upstream
Header Proxy
nginx.conf31 righe
# Generated by Nginx Config Generator - federicocalo.dev
# 2026-08-04T11:47:22.096Z
upstream backend {
server 127.0.0.1:8080;
}
server {
listen 80;
server_name example.com;
# Gzip compression
gzip on;
gzip_min_length 1024;
gzip_types text/plain text/css application/json application/javascript text/html;
gzip_vary on;
gzip_comp_level 6;
# Security headers
add_header X-Frame-Options "DENY" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Content-Security-Policy "default-src 'self'" always;
location / {
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}Guida Rapida
- Corrispondenza location
= /uri- esatto |~* \.ext$- regex |/prefix- prefisso- Buffering del proxy
proxy_buffering on+proxy_buffer_size- WebSocket
- Aggiungi gli header proxy
Upgrade+Connection - Let's Encrypt
- Usa certbot:
certbot --nginx -d example.com - Testa la configurazione
nginx -tpoinginx -s reload- Formato dei log
access_log /var/log/nginx/access.log combined;
Come utilizzare Generatore Config Nginx
Choose configuration type
Select one of the 5 modes: Reverse Proxy, Static Files, Load Balancer, SSL/HTTPS or Single Page App. The available fields section changes based on the chosen mode.
Fill in server fields (name, port, upstream)
Set server_name and listen port; for reverse proxy, load balancer and SSL/HTTPS add one or more upstream servers with address and weight, and choose the balancing method (round robin, least_conn, ip_hash).
Activate advanced options
Enable gzip, rate limiting (limit_req_zone), caching (proxy_cache), and security headers (X-Frame-Options, CSP, HSTS) as needed: each option generates corresponding Nginx blocks only if enabled.
Copy or download the generated nginx.conf file
Preview updates in real-time while modifying fields. Use the Copy or Download buttons to obtain the ready-to-install nginx.conf file on your server.
Suggerimenti
- For Angular/React applications with client-side routing always use the SPA mode: static file mode would cause 404 on internal route refreshes.
- Always activate the Upgrade/Connection header between proxy headers when the backend uses WebSockets, otherwise the connection will be rejected by the reverse proxy.
- Always check your Nginx configuration before deploying to production: a syntax error with Nginx -s reload can interrupt the service.
Domande frequenti
What types of configurations can I generate?
The tool generates 5 types of configuration: Reverse Proxy (forwards requests to a backend), Static Files (serves a directory), Load Balancer (distributes traffic across multiple backends with round robin, least_conn or ip_hash), SSL/HTTPS (SSL certificate with automatic HTTP redirect), and SPA (falls back to index.html with aggressive caching of static assets).
How does the rate limiting generated by the tool work?
When rate limiting is enabled, the tool generates a global directive `limit_req_zone` based on `$binary_remote_addr` with zone, size (10m), and request rate per second you set, plus a `limit_req` directive in the location block with burst configuration and nodelay.
Is the SSL certificate generated by the tool?
No, the tool only generates Nginx configuration that references SSL certificate and key paths you input (e.g. those produced by Let's Encrypt/certbot). It does not generate valid real certificates: you need to get them separately, for example with certbot --nginx -d example.com.
What's the difference between the "Static Files" configuration and SPA?
Static Files uses try_files $uri $uri/ =404, suitable for classic multi-page sites. SPA uses try_files $uri $uri/ /index.html for client-side fallback on all routes (Angular/React/Vue routing) plus an aggressive cache block (1 year) for assets with js/css/font/image extensions.
Is the generated configuration ready for production without modifications?
Configuration is syntactically valid and follows common best practices, but real paths (certificates, root path) must always be personalized and tested with nginx -t before reload (nginx -s reload). Also, verify that security header and CSP values are consistent with your application.