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.
Run nginx -t before you reload nginx. The certificate paths are the ones that certbot uses.
How to Use It
- Choose the site type and the domain.
- Choose the options.
- 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.
Related Tools
Source code of this tool (opens in a new tab)Report a problem on GitHub (opens in a new tab)