Home
Nginx Server Block & Reverse Proxy Config Generator

Visual Nginx Server Block & Reverse Proxy Configurator

Generate secure, battle-tested Nginx configurations with SSL/TLS hardening, WebSocket upgrade proxies, gzip compression, and rate limiting. Built completely client-side in your browser.

Quick Architecture Presets (Load Sample)
Output Target Format:

Domain & Routing Profile

Configure your domain names, listening ports, and application runtime type.

example.com.conf(121 lines • 3.9 KB)
Nginx Config Output
UTF-8 • Client-Side Generated
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# ====================================================================# Nginx Configuration for: example.com www.example.com# Generated by ToolsAA Visual Nginx Configurator (100% Client-Side)# Date: 2026-11-25# ====================================================================# [NOTE] Recommended helper inside http {} block for robust WebSocket upgrades:# map $http_upgrade $connection_upgrade {# default upgrade;# '' close;# }server { listen 80; listen [::]:80; server_name example.com www.example.com; # ACME Let's Encrypt challenge webroot verification location ^~ /.well-known/acme-challenge/ { default_type "text/plain"; root /var/www/letsencrypt; } # Force 301 Permanent Redirect to HTTPS location / { return 301 https://$host$request_uri; }}server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name example.com www.example.com; server_tokens off; # SSL / TLS Certificates ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off; ssl_session_cache shared:SSL:10m; ssl_session_timeout 1d; ssl_session_tickets off; # OCSP Stapling ssl_stapling on; ssl_stapling_verify on; resolver 1.1.1.1 8.8.8.8 valid=300s; # Security Headers add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; 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; add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'; frame-ancestors 'self';" always; # Client Max Body Size & Timeouts client_max_body_size 16M; keepalive_timeout 65; # Gzip Compression gzip on; gzip_vary on; gzip_proxied any; gzip_comp_level 6; gzip_min_length 256; gzip_types text/plain text/css text/javascript application/javascript application/json application/xml image/svg+xml font/woff2; # Open File Cache open_file_cache max=10000 inactive=30s; open_file_cache_valid 60s; open_file_cache_min_uses 2; open_file_cache_errors on; # Logging access_log /var/log/nginx/example.com.access.log combined buffer=512k flush=1m; error_log /var/log/nginx/example.com.error.log warn; # Reverse Proxy Pass location / { proxy_pass http://127.0.0.1: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; proxy_set_header X-Forwarded-Host $host; # WebSocket Upgrade proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # Timeouts & Buffering proxy_connect_timeout 60s; proxy_send_timeout 60s; proxy_read_timeout 60s; proxy_buffering off; } # Static Assets Browser Caching location ~* \.(css|js|jpg|jpeg|gif|png|ico|webp|svg|woff|woff2|ttf|eot)$ { expires 1y; add_header Cache-Control "public, no-transform, immutable"; access_log off; log_not_found off; } # Deny Hidden Files (.git, .env, .htaccess) location ~ /\. { deny all; access_log off; log_not_found off; } # Deny Sensitive Backup & Source Code Files location ~* (\.(bak|config|sql|fla|psd|ini|log|sh|inc|swp|dist|env)|composer\.lock)$ { deny all; access_log off; log_not_found off; }}
Nginx CLI Test & Reload Cheat Sheet
sudo nginx -tVerify Syntax
sudo systemctl reload nginxZero-Downtime Reload
sudo certbot --nginx -d example.comGet Free SSL Cert
sudo ln -s /etc/nginx/sites-available/x /etc/nginx/sites-enabled/Enable Site

Zero-Knowledge Local Execution

All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.

Instant Client-Side Engine

Instant real-time reactive computation delivers immediate feedback on every keystroke with zero network latency.

Production Standards & Compliance

Strictly validates syntax, edge cases, and formatting rules for dependable production output.

Technical Reference & Architecture Guide

Nginx Server Block & Reverse Proxy Config Generator — Reference Guide

Interactive visual builder for high-performance Nginx configurations. Generate reverse proxy rules, SSL/TLS modern hardening, HTTP/2 & HTTP/3, WebSocket upgrade headers, and compression directives with 100% client-side privacy.

Nginx Server Block & Reverse Proxy Config Generator — Reference Guide — Client-Side In-Memory Architecture & Data Flow
Nginx Server Block & Reverse Proxy Config Generator — Reference Guide — Client-Side In-Memory Architecture & Data Flow

Key Parameters & Controls

Key Parameters & Controls
ParameterType / UnitDescriptionDefault
listendirectiveSpecifies the IP address and port for incoming connections, including SSL, HTTP/2, and HTTP/3 flags.80 / 443 ssl
server_namedirectiveDefines virtual host domain names matching HTTP Host header values.example.com
proxy_passdirectivePoints incoming requests to an upstream microservice URL, IP port, or UNIX socket.http://127.0.0.1:3000
ssl_protocolsdirectiveEnforces modern, secure cryptographic transport protocols (TLSv1.2, TLSv1.3).TLSv1.2 TLSv1.3

Pro Tips & Best Practices

Pass Real Client IP Headers

Always configure 'proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for' and 'proxy_set_header X-Forwarded-Proto $scheme' to preserve client identities.

Enable Native WebSocket Upgrades

Include 'proxy_set_header Upgrade $http_upgrade' and 'proxy_set_header Connection 'upgrade'' inside reverse-proxied location blocks.

Harden Security Headers

Inject Strict-Transport-Security (HSTS), X-Content-Type-Options: nosniff, and X-Frame-Options: SAMEORIGIN to defeat clickjacking and MIME attacks.

Common Gotchas & Troubleshooting

⚠️502 Bad Gateway error when proxying to local service

Verify that your backend process (Node, Python, Go) is running and listening on the designated port or UNIX socket.

⚠️Infinite redirect loop when combining Nginx and Cloudflare

Set your Cloudflare SSL/TLS mode to 'Full (Strict)' to match Nginx's port 443 HTTPS redirection rules.

Frequently Asked Questions

How does this tool generate secure SSL/TLS configurations?▼

The generator applies Mozilla's recommended Intermediate and Modern TLS configurations, activating secure ECDHE cipher suites and disabling broken legacy protocols (SSLv3, TLSv1.0, TLSv1.1).

Why is client_max_body_size important?▼

By default, Nginx limits file uploads to 1MB. Raising client_max_body_size (e.g. to 50M) prevents HTTP 413 (Payload Too Large) errors on file uploads.

What is the difference between proxy_pass with or without a trailing slash?▼

A trailing slash (http://127.0.0.1:3000/) replaces the matching location URI prefix, while omitting it passes the original request path unmodified.

How do I safely test my Nginx configuration before reloading?▼

Always execute 'nginx -t' in your terminal to verify syntax validity before running 'systemctl reload nginx'.