NGINX Config Builder

Generate a correct NGINX server block — reverse proxy, static hosting, SSL and redirects — without hand-writing directives.

Server

Location /

Generated config

server {
    listen 80;
    listen [::]:80;
    server_name example.com;
    client_max_body_size 10M;
    gzip on;
    gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;

    location / {
        proxy_pass http://127.0.0.1:3000;
        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;
    }
}

About this tool

NGINX configuration is powerful but unforgiving: directives must sit in the right context, proxy setups need the right forwarded headers to avoid broken client IPs and redirect loops, and a missing try_files line is the classic reason a single-page app 404s on refresh. This builder assembles a correct server block from a form so you get the boilerplate right.

Add location blocks of three kinds — a reverse proxy (with Host and X-Forwarded-* headers pre-filled), static hosting from a document root (with an optional SPA fallback to index.html), or a redirect with your chosen status code. Turn on SSL to emit listen 443 ssl with your certificate paths, and enable HTTP-to-HTTPS to generate a companion port-80 server that permanently redirects. Optional gzip and client_max_body_size round out the common cases. Everything runs in your browser.

How to use

  1. Set the server basics

    Enter the server name (domain) and listen port, or enable SSL to switch to 443.

  2. Add location blocks

    Choose reverse proxy, static files or redirect for each path and fill in the target.

  3. Enable SSL and redirects

    Turn on SSL with your cert/key paths and add an HTTP→HTTPS redirect if needed.

  4. Copy the config

    Copy the generated server block into sites-available and reload NGINX.

Location types

TypeGenerates
Reverse proxyproxy_pass + Host / X-Real-IP / X-Forwarded-For / X-Forwarded-Proto
Static filesroot + try_files (with optional SPA fallback to index.html)
Redirectreturn <code> <target>;
SSLlisten 443 ssl + ssl_certificate / ssl_certificate_key
HTTP→HTTPSA port-80 server that 301-redirects to HTTPS

Config is generated client-side — nothing is uploaded.

Frequently asked questions