Generate Nginx, Caddy & Apache reverse proxy configs with SSL & presets
Visual reverse proxy config builder supporting Nginx, Caddy, and Apache. Features production-ready presets for Next.js, SPAs, Node APIs, WebSockets, Let’s Encrypt SSL/TLS, rate limiting, and real-time security antipattern linting.
Keywords: nginx, caddy, apache, reverse proxy, load balancer, ssl, tls, https, rate limiting, gzip, nextjs, spa
Tags: nginx, caddy, apache, reverse-proxy, ssl, tls, rate-limit, devops, sysadmin, webserver
Nginx Config Generator is also known as: nginx generator, caddyfile generator, reverse proxy config builder, nginx reverse proxy tool, nginx ssl config builder.
Select an application preset (Next.js 15 App Router, React/Vite SPA, Node.js API Cluster, Python FastAPI, or Static Website) or start from a custom blank configuration.
Set your primary domain names and aliases in the Server tab (e.g. example.com, api.example.com) and configure your listening ports and IPv6 dual-stack bindings.
Define your upstream server pools and load balancing algorithms (Round Robin, Least Connections, or IP Hash session affinity) with health-checks, weights, and failover backups.
Customize location route rules in the Routes tab: configure proxy_pass targets, try_files SPA client routing, static asset caching with immutable headers, WebSockets, and Server-Sent Events (SSE) streaming.
Enable SSL/TLS termination in the SSL/TLS tab: set Let’s Encrypt Certbot or custom certificate paths, enforce HTTP-to-HTTPS 301 redirects, HTTP/2, HTTP/3 QUIC, HSTS preloading, and OCSP stapling.
Configure performance optimizations in the Speed tab: tune Gzip compression levels and MIME types, define rate-limiting token bucket zones (limit_req_zone), and enable kernel zero-copy sendfile.
Harden your web server in the Security tab: configure X-Frame-Options clickjacking protection, nosniff MIME checking, Content-Security-Policy (CSP), hidden dotfile blocking (.git/.env), and CORS preflight handling.
Switch between Nginx (nginx.conf), Caddyfile, and Apache VirtualHost tabs to preview live generated configs and review real-time diagnostic antipattern warnings before copying or downloading your file.
Multi-Server Support: Generates production-ready configurations for Nginx (nginx.conf), Caddy (Caddyfile), and Apache HTTP Server (<VirtualHost>) from a unified visual builder.
Production Application Presets: One-click battle-tested configurations for Next.js 15 (App Router with streaming & static asset caching), Single Page Apps (React/Vite/Vue try_files routing), Node/Bun API clusters, Python FastAPI/Uvicorn ASGI, and static websites.
Zero-Configuration WebSockets & Streaming: Automatically generates HTTP upgrade maps (`map $http_upgrade $connection_upgrade`) and sets `proxy_buffering off` for Server-Sent Events (SSE) and LLM streaming responses.
Let’s Encrypt & Modern TLS 1.3: Built-in ACME challenge passthrough (`/.well-known/acme-challenge/`), automatic HTTP-to-HTTPS 301 redirection, HSTS with includeSubDomains & preload, OCSP stapling with fast DNS resolvers, and modern TLS 1.3 cipher suites.
Load Balancing & Upstream Failover: Configure multi-server upstream pools with Round Robin, Least Connections (`least_conn`), and IP Hash affinity, plus server weights, connection limits, and backup failover nodes.
Fine-Grained Rate Limiting: Configures token bucket rate limiting (`limit_req_zone` and `limit_req`) per client IP or server name with burst allowances, `nodelay` processing, and custom 429 HTTP status responses.
Static Asset Caching & Gzip Compression: Configures aggressive immutable caching headers (`Cache-Control: public, max-age=31536000, immutable`) for hashed assets alongside multi-level Gzip compression across 10+ standard web MIME types.
OWASP & Mozilla Observatory Hardening: Pre-configures essential HTTP response headers including X-Frame-Options, X-Content-Type-Options: nosniff, Referrer-Policy, Permissions-Policy, and automated denial of sensitive dotfiles (.git, .env, .DS_Store).
Full CORS Preflight Handling: Generates automated 204 OPTIONS preflight interception, Access-Control-Allow-Origin, allowed methods, allowed headers, and credential policies directly within server blocks.
Real-Time Antipattern Linter: Analyzes configurations on-the-fly to warn against dangerous "If is Evil" location directives, unreferenced upstream targets, missing SSL certificate paths, and unencrypted HTTP exposures.
100% Client-Side Privacy: All template rendering and diagnostic analysis executes locally in your browser. Internal infrastructure hostnames, IP addresses, and routing topologies never touch external servers.
REST API Integration: Generate Nginx, Caddy, and Apache configurations programmatically via the `/api/tools/nginx-config-generator` endpoint for automated DevOps provisioning and CI/CD pipelines.
The Nginx Config Generator supports 3 syntax formats and dialects for accurate parsing and processing.
Generate Nginx, Caddy & Apache reverse proxy configs with SSL & presets
Enter hostnames or domains this server handles (e.g. example.com, api.example.com, localhost).
Bind to dual-stack IPv6 addresses
Define backend server pools for load balancing and proxy targets.
# ==============================================================================
# Nginx Server Configuration — Generated for example.com
# Preset: nextjs
# ==============================================================================
upstream nextjs_upstream {
server 127.0.0.1:3000;
keepalive 32;
}
# WebSocket Connection Upgrade Map
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Rate Limiting Zones
limit_req_zone $binary_remote_addr zone=req_limit:10m rate=10r/s;
limit_req_status 429;
# HTTP -> HTTPS Redirect Server
server {
listen 80;
listen [::]:80;
server_name example.com www.example.com;
# Let's Encrypt ACME Challenge passthrough
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
allow all;
}
location / {
return 301 https://$host$request_uri;
}
}
# Main Application Server
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.com www.example.com;
root /var/www/html;
index index.html index.htm;
# SSL/TLS Configuration
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
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_stapling on;
ssl_stapling_verify on;
resolver 1.1.1.1 8.8.8.8 valid=300s;
resolver_timeout 5s;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
# 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;
add_header Cross-Origin-Opener-Policy "same-origin" always;
add_header Permissions-Policy "camera=(), microphone=(), geolocation=()" always;
# Performance & Tuning
server_tokens off;
client_max_body_size 16M;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
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 application/xml+rss image/svg+xml application/wasm font/woff2;
# Logging
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log warn;
# Global Rate Limiting
limit_req zone=req_limit burst=20 nodelay;
# Block Hidden Files & Directories (.git, .env, etc.)
location ~ /\.(?!well-known) {
deny all;
access_log off;
log_not_found off;
}
location /_next/static/ {
proxy_pass http://nextjs_upstream;
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;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
expires 365d;
add_header Cache-Control "public, max-age=31536000, immutable";
access_log off;
}
location /static/ {
proxy_pass http://nextjs_upstream;
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;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
expires 30d;
add_header Cache-Control "public, max-age=2592000";
access_log off;
}
location / {
proxy_pass http://nextjs_upstream;
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;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_read_timeout 86400s;
proxy_send_timeout 86400s;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 300s;
}
}