Nginx Config Generator

Choose what the site is and how it should behave, and get a server block ready for /etc/nginx/sites-available, plus the commands to enable it and get a certificate.

  • Free
  • No Sign-Up
  • Runs in Your Browser
Site Type
Pick a site type to build its config.

How to Use

How to use the Nginx Config Generator

  1. 01

    Pick the site type

    Reverse proxy to an app, a static site, or PHP with PHP-FPM.

  2. 02

    Set the details

    Domain, upstream or root, HTTPS and redirects.

  3. 03

    Install it

    Save the file, test with nginx -t, reload, then run certbot.

VPS & Linux

About the Nginx Config Generator

Reverse proxy essentials

A reverse proxy must pass the original host and client address to the app (Host, X-Real-IP, X-Forwarded-For and X-Forwarded-Proto), or the app will build wrong links and log every visitor as 127.0.0.1. WebSocket apps also need the Upgrade and Connection headers and HTTP/1.1 to the upstream.

Always run nginx -t before reloading: a typo stops the reload but leaves the old configuration serving, while a restart with a bad file takes every site down.

HTTPS

The generated block uses the paths certbot creates. Get the certificate first with the HTTP-only block (or certbot --nginx), then switch to the HTTPS version. HSTS is included but commented out: enable it once you are sure HTTPS works on every subdomain, as browsers remember it for months.

What it can't tell you

  • Starter configurations; tune caching, rate limits and timeouts for your app.

Frequently asked questions

Where do Nginx config files go?
On Debian and Ubuntu: /etc/nginx/sites-available/, linked into sites-enabled. On RHEL-based systems: /etc/nginx/conf.d/name.conf.
How do I fix 413 Request Entity Too Large?
Raise client_max_body_size in the server block (it is 1 MB by default), then reload Nginx.
How do I redirect www to non-www?
A separate server block for www.example.com that returns 301 to https://example.com$request_uri. Tick the redirect option to include it.

Run VMs for other people?

Frabs stops spam, scans and floods leaving your customers' VMs, before the abuse report lands.