← All Tools

Nginx Config Generator🔒 100% local

Generate server blocks. Privacy-first, no server uploads, no tracking.

Related Tools

Anagram GenAscii ArtBarcode Generator

Writes an nginx server block from three comma-separated values - domain, port and document root - plus an optional fourth value for the mode: "spa" for client-side routing, or "proxy" and "proxy:3000" for a reverse proxy. The block carries listen lines for IPv4 and IPv6, security headers, gzip settings, a one-year cache rule for fingerprinted assets and a try_files location.

How to use it

  1. Enter "domain, port, root", for example "example.com, 80, /var/www".
  2. Add a fourth value when you need one: "spa" or "proxy:3000".
  3. Press Process, then copy the block into /etc/nginx/sites-available/ - the output also prints the symlink, the nginx -t check and the reload command.

Worked example

example.com, 80, /var/wwwbecomesGenerated nginx server block — example.com on port 80, static files server { listen 80; listen [::]:80; server_name example.com www.example.com; root /var/www; index index.html index.htm;

The first six lines only. What follows adds the security headers, gzip block, immutable-cache location, try_files location, deploy commands and the gotchas list.

app.example.com, 443, /var/www/app, spabecomes# SPA: send unknown paths to index.html so client routing works location / { try_files $uri $uri/ /index.html; }

The spa mode replaces the default "=404" fallback, and the server_name line becomes "app.example.com www.app.example.com".

When to use it

What it does not do