DevOps
Toolin.io

Nginx Config Generator

Generate Nginx configuration files for common setups

Select Template

Basic Settings

Upstream Backend

Features

Custom Location Blocks

Generated Configuration

# Main server configuration
server {
    listen 80;
    listen [::]:80;
    server_name example.com;

    # Gzip compression
    gzip on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss application/rss+xml font/truetype font/opentype application/vnd.ms-fontobject image/svg+xml;

    # 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 Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;

    # Reverse proxy configuration
    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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_cache_bypass $http_upgrade;
    }
}
About Nginx Config Generator

What is Nginx Config Generator?

Generate production-ready Nginx configuration files from templates. Supports reverse proxy, static sites, SPAs, SSL, load balancers, and PHP-FPM with security headers, gzip, and rate limiting.

Features & Benefits

  • Templates for reverse proxy, static, SPA, SSL, and more
  • SSL/TLS configuration with modern cipher suites
  • Security headers: HSTS, X-Frame-Options, CSP
  • Gzip compression and cache header settings
  • Rate limiting and load balancer support
  • Commented config explaining each directive

Frequently Asked Questions

What templates are available?
Reverse proxy, static file server, SPA (React/Vue), SSL redirect, load balancer, and PHP-FPM. Each is fully customizable.
Does this generate SSL configuration?
Yes. Enter certificate paths and the tool generates modern TLS config with recommended cipher suites.
Can I add custom location blocks?
Yes. Click 'Add Location Block' to define custom paths with proxy, static, or redirect behavior.

Related Tools

100% Private & Secure

This tool runs entirely in your browser. Your files and data never leave your device and are not uploaded to any server.