Nginx Config Formatter

Format and indent nginx configuration files with properly nested blocks.

Paste an nginx configuration and get it back with correctly indented nested blocks, consistent spacing between directives and their values, and blank lines between top-level server/upstream blocks. Makes complex nginx configs readable at a glance.

nginx config
0 chars1 lines
formatted configREADY
0 chars1 lines

Related Tools

FAQ

What indentation style does the formatter use?
Each nested block level is indented by 4 spaces. Opening braces stay on the same line as the block name, and closing braces are on their own line, matching the nginx official style.
Are comments preserved?
Yes — lines starting with # are treated as comments and preserved exactly as-is, placed above the directive they annotate.
Does it validate nginx syntax?
No — the formatter is purely structural. It reindents based on { and } braces. For full nginx syntax validation, run nginx -t on your server.