TOOLTIKI Lovable tool, really free
Developer Config

nginx config formatter

Indent

Processed in your browser · nothing is uploaded

Local · formatting only — nginx -t is the authority
Advertisement
320 × 100

Reindents an nginx configuration by block depth. Braces set the level, directives sit inside, and blank lines between blocks are kept to one.

How to use the nginx config formatter

1 Paste your input. The result appears immediately.
2 Adjust the indent if the default is not yours.
3 Copy the result, or save it as a file.

nginx configuration is a tree of blocks, and depth is the only thing indentation communicates — the parser ignores whitespace entirely. What indentation buys you is seeing which `location` a directive belongs to, and that matters because nginx directive inheritance is genuinely surprising: a directive in a `location` block does **not** merge with the same directive in the enclosing `server` block, it replaces it. The classic case is `proxy_set_header`. Setting one header inside a `location` discards every `proxy_set_header` from the enclosing scope, so the `Host` header you set at server level silently disappears. Seeing the nesting clearly is how you notice. One thing this does not do is validate. `nginx -t` is the only authority on whether a config is correct, and it checks things no formatter can — that referenced files exist, that a certificate matches its key, that a directive is legal in the context it appears in.

Questions

No, it is ignored. What it buys you is seeing which block a directive belongs to.

nginx — configuration file structure
Advertisement
300 × 250
Was this tool any good?
INTERNAL SIGNAL ONLY · WE USE IT TO FIND TOOLS WORTH REBUILDING