← Developer

NGINX CONFIG GENERATOR

Generate production-ready nginx configurations — reverse proxy, static sites, SSL, security headers, gzip, WebSocket support. All client-side, shareable via URL.

PRESET:

SERVER

PROXY

PERFORMANCE

SECURITY HEADERS

NGINX CONFIG
server {
    listen 80;
    listen [::]:80;
    server_name example.com;


    # Security headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "strict-origin-when-cross-origin" always;

    # Performance
    sendfile on;
    tcp_nopush on;
    tcp_nodelay on;
    keepalive_timeout 65;

    # Gzip compression
    gzip on;
    gzip_comp_level 6;
    gzip_vary on;
    gzip_proxied any;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
    gzip_min_length 256;

    location / {
        # Upstream application server
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;

        proxy_set_header Connection "";

        # Pass client info to upstream
        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;

        # Timeouts
        proxy_connect_timeout 60s;
        proxy_send_timeout 60s;
        proxy_read_timeout 60s;

        # Proxy buffering — improves performance for slow clients
        proxy_buffering on;
        proxy_buffer_size 128k;
        proxy_buffers 8 128k;
    }

    # Logs
    access_log /var/log/nginx/example.com.access.log;
    error_log /var/log/nginx/example.com.error.log warn;
}