WHAT IT DOES
Including the lines that do not go in the server block.
Choose a preset, name the domain, and point it at an upstream or a directory. The output is a complete server block, plus the directives that have to live in the http block instead — the WebSocket connection map and the rate-limit zone, both of which stop nginx from starting if they are pasted in the wrong place. Three presets set the toggles; changing any of them makes the configuration yours, and the preset stops claiming otherwise.
Why use it?
Common Nginx setups need related directives in the correct contexts. A starting configuration helps assemble those pieces, while leaving host-specific review and validation to you.
How to use this tool
- Choose the configuration preset and enter the actual domain, paths, and upstream settings it requires.
- Generate the configuration and read its comments, including any separately labelled http-context sections.
- Place the sections in the appropriate configuration files on a test host and run nginx -t before reloading. Check backend availability separately.
Details and limitations
- Directives that only exist in the http context are written into their own labelled section above the server blocks, with a comment saying where they go.
- WebSocket support writes proxy_http_version 1.1 and the Upgrade and Connection headers together with the map that defines $connection_upgrade, because the headers alone reference a variable that does not exist.
- Security headers stay at server level. An add_header inside a location replaces every header inherited from the server rather than adding to them, which is how headers disappear from exactly the responses that needed them.
- Redirecting HTTP keeps serving /.well-known/acme-challenge over plain HTTP, since redirecting the challenge is how certificate renewal quietly stops working.
- HSTS without TLS is refused rather than written, and when it is written the note says it lasts a year: a browser that has seen it will not fall back to plain HTTP for that long.
- Every generated file is checked by tests for balanced braces and terminated directives, and each preset is generated with every option turned on to prove it still parses.