✅ Nginx config copied

🌍 Nginx Config Generator

Reverse proxy · Load balancing · SSL · Rewrite · Production best practices

🔄
Reverse Proxy
Forward requests to backend, WebSocket, custom headers
⚖️
Load Balancing
Round‑robin / least_conn / ip_hash, health checks, weights
🔒
SSL Certificate
HTTPS, HSTS, OCSP Stapling, HTTP/2, security headers
🔄
Rewrite Rules
301/302 redirects, mobile adaptation, error pages

📄 Nginx Config Preview

Syntax check passed, ready for production
# Nginx config will appear here

Nginx quick commands

# Test configuration syntax
nginx -t -c /etc/nginx/nginx.conf

# Reload configuration smoothly
nginx -s reload

# Check port usage
netstat -tlnp | grep :80

📖 Online Nginx Config Generator: From Dev to Production

Nginx is the world's most popular web server and reverse proxy, powering over 30% of global websites. ng.cc's online Nginx config generator covers four core scenarios: reverse proxy, load balancing, SSL certificates, and URL rewriting. All configurations follow production best practices. No need to memorize Nginx syntax – visual configuration, one‑click download. 100% client‑side, zero upload.

🔄 Reverse Proxy

WebSocket support, custom headers, timeout control, buffer tuning. Auto‑adds X-Forwarded-* headers, hides Nginx version.

⚖️ Load Balancing

Round‑robin, least_conn, ip_hash algorithms. Weight, health checks, backup servers. Automatically generates upstream block.

🔒 SSL/HTTPS

TLSv1.2/1.3, HSTS, OCSP Stapling, HTTP/2, security headers. Compliant with Let's Encrypt deployment standards.

🔄 Rewrite Rules

301/302 redirects, static‑to‑dynamic, mobile adaptation, custom error pages. Supports regular expressions.

🎯 Nginx Use Cases

💡 Nginx Core Concepts

🔹 upstream block

Defines a group of backend servers with weight, max_fails, backup. Algorithms: round‑robin, least_conn, ip_hash.

🔹 server block

Virtual host: listen port, domain name, SSL settings, root directory, index files. One Nginx can host many sites.

🔹 location matching

Exact (=), regex (~), prefix matching. Priority: exact > regex > prefix.

🔹 proxy_pass

Forwards requests to a backend (http, https, upstream group). Automatically adjusts Host header.

❓ Frequently Asked Questions

Q1: Can I use the generated config directly in production?
Yes. The generated configuration follows official Nginx best practices, including security headers, performance tuning, and error handling. You only need to adjust server_name, proxy_pass, certificate paths etc. Run nginx -t to verify syntax before deploying.
Q2: Does it support WebSocket proxying?
Fully supported. In reverse proxy mode, check the "WebSocket support" option – the config will automatically add Upgrade and Connection headers. Works with Node.js, Django Channels, Spring WebSocket, etc.
Q3: How do I choose the load balancing algorithm?
- round‑robin: default, equal distribution, good for similar servers.
- least_conn: forwards to server with fewest active connections, ideal for long‑lived connections.
- ip_hash: same client IP always goes to same server, solves session affinity.
Q4: What is HSTS in SSL config?
HSTS (HTTP Strict Transport Security) forces browsers to always use HTTPS, preventing protocol downgrade and MITM attacks. This tool enables HSTS by default with max‑age=63072000s (2 years) and includeSubDomains. Ensure your HTTPS works perfectly before enabling.
Q5: How to debug rewrite rules?
Add rewrite_log on; inside the server block and check error logs: error_log /var/log/nginx/rewrite.log notice;. Our generated rules are standard – test with curl: curl -I http://example.com/old-path.
Q6: Is my configuration data sent to any server?
Absolutely not. This is a static HTML page – all generation logic runs inside your browser's JavaScript. You can even go offline and it still works. Your domain, IP, certificate paths etc. never leave your device.

🔗 Recommended Tools

This tool is part of the ng.cc DevOps collection. You might also like:

⚡ All configs are generated locally – your server information never leaves your browser.