Nginx Config Generator
This tool generates an Nginx server block. Choose a static site, PHP with PHP-FPM or a proxy to an app, and add HTTPS, redirects, caching and headers.
- Free, no sign-up
- Nothing is sent to a server
- Worldwide
How to use Nginx Config Generator online
- Pick the site type. Static, PHP or proxy.
- Fill in the details. Domain, folder or app address.
- Choose options. HTTPS, www, compression, caching and headers.
- Copy and test. Save the file and run nginx -t.
Why use this free Nginx Config Generator
- Static, PHP and proxy sites
- HTTPS and redirects
- Compression and caching
- Security headers
- Upload limit
- Share by link
What it writes
An Nginx site is described in a server block that says which domain it answers, where the files are and what to do with requests. The tool writes the block from your choices: the domain, the folder or the app address, whether to use HTTPS, how to treat the www name, compression, caching, headers and the largest upload.
Three kinds of site
A static site serves files from a folder. A PHP site passes requests for .php files to PHP-FPM through a socket, and sends other requests to index.php, the way many frameworks expect. A proxy site hands every request to an app such as Node or Python on another port, and adds the headers the app needs to know the real address of the visitor.
A worked example
For example.com as a PHP site with HTTPS, the tool writes 3 server blocks in 54 lines. One redirects port 80 to HTTPS, one sends www to the bare domain and one serves the site. The main block begins:\nserver { listen 80; listen [::]:80; server_name example.com www.example.com; return 301 https://example.com$request_uri; }
HTTPS and headers
With HTTPS on, you give the paths of the certificate and key. A free certificate from Let’s Encrypt is a common choice. The tool also writes a Strict-Transport-Security header, which tells browsers to use HTTPS for a year, so switch HTTPS on only if you mean to keep it. Basic security headers are on by default.
Before you use it
Treat the result as a starting point. Save it in the sites folder of Nginx, run nginx -t to test the syntax, then reload Nginx. Check the paths and the PHP socket name for your system. The tool writes text and cannot test your server, and it is not a full hardening guide.
Using the tool
The Nginx Config Generator works again whenever the text or an option changes. Open a text file into the box, or drop one on it.
Nginx Config Generator: frequently asked questions
How do I test an Nginx config?
How do I serve PHP?
How do I proxy to Node?
Is HSTS safe to turn on?
Does it get a certificate for me?
Does the Nginx Config Generator keep a copy of my text?
Can I copy the Nginx Config Generator result?
Related searches for Nginx Config Generator
- Nginx Config Generator online
- free Nginx Config Generator
- Nginx Config Generator online free
- Nginx Config Generator for mobile
- Nginx Config Generator without sign up
- Nginx Config Generator – Text & Writing Tools
Nginx Config Generator is a free online tool on MAITBOX, in the Text & Writing Tools group. It runs in your browser, so what you type is not sent to a server. It works on Android and iPhone, and on Windows, Mac and Linux, with no download and no account.