Skip to main content
HandyWeb

Nginx Config Generator

Create an nginx config for a static site, a React or Vue app, or a reverse proxy, with HTTPS, www redirect, gzip, caching, and security headers.

Site type

Run nginx -t before you reload nginx. The certificate paths are the ones that certbot uses.

How to Use It

  1. Choose the site type and the domain.
  2. Choose the options.
  3. Put the file in /etc/nginx/conf.d/, run nginx -t, and reload nginx.

Questions and Answers

How is an SPA different from a static site?

In an SPA, a path without a file goes to index.html so the JavaScript router can read it. In a static site, such a path gives 404.

Good to Know

For nginx 1.25 or later (the http2 on directive). Get the certificate yourself with certbot. The tool does not connect to your server.

Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)