Nginx Config Formatter

Line-break and indent by { } and ; to tidy up conf hierarchy

How to use

  1. Paste the conf into the "Nginx config" box.
  2. Click "Format"; the tool breaks lines and indents by { } and ;.
  3. The result is in "Result"; click "Copy" to take it.
  4. Tip: content inside quotes is kept whole, so semicolons or braces inside won't break lines wrongly.

FAQ

Will content inside quotes be split incorrectly?

No. Content within double or single quotes is preserved as a whole and will not be wrongly broken by ; or { inside it.

Does it support blocks like if / upstream?

Yes. Any block wrapped in { } is indented correctly, matching the official config hierarchy.