Search tools

Search for a command to run...

Nginx Config Generator

Generate an nginx server block for a static site, SPA or reverse proxy — with HTTPS (Let's Encrypt paths), HTTP→HTTPS and www redirects, gzip and caching.

How to use

  1. 1Enter your domain and choose the site type.
  2. 2Save the output as /etc/nginx/sites-available/<domain>, symlink it into sites-enabled, then run nginx -t and reload.

Frequently asked questions

How do I get the SSL certificate?

Run certbot --nginx -d example.com -d www.example.com (or certbot certonly). The config uses the standard /etc/letsencrypt/live paths.

What does the SPA option do?

It adds try_files … /index.html so client-side routes (like /about) load your single-page app instead of a 404.

Why proxy_set_header lines?

They pass the real client IP, host and protocol to your app, which it needs for logging, redirects and secure cookies.