jarvisbox

NGINX Config Formatter

Paste an NGINX configuration file to get a cleanly formatted, consistently indented result. Runs entirely in your browser — no upload, no account.

100% client-side · no upload

How to use the NGINX Config Formatter

  1. Paste your nginx.conf or a server block snippet into the left panel.
  2. Choose your preferred indent size (2 or 4 spaces).
  3. The formatted output updates automatically on the right.
  4. Click Copy to copy the result to your clipboard.
  5. Paste into your config file and run sudo nginx -t to validate before reloading.

Common use cases

Related tools: .htaccess Builder · Dockerfile Linter · GitHub Actions Linter · All DevOps Tools

よくある質問

Is my NGINX config sent to a server?
No. Formatting runs entirely in your browser. Your hostnames, upstream addresses, SSL certificate paths, and any other server details never leave your device.
What does the formatter change?
The formatter normalises indentation (2 or 4 spaces per level), ensures each directive ends with a semicolon on its own line, and aligns opening braces on the same line as the block name.
Does it validate the NGINX config syntax?
The formatter does basic structural validation — it will report mismatched braces. For full syntax validation, run nginx -t on your server or in a Docker container.
Can I use this for OpenResty or Tengine configs?
Yes. OpenResty and Tengine follow the same block-based syntax as NGINX. The formatter handles Lua directives inside content_by_lua_block as plain text.
Why does my formatted config look different from nginx -T output?
nginx -T dumps the parsed, merged configuration which may reorder or expand include directives. This tool formats the text as-is without include resolution.
How should I handle include directives?
Includes are kept as-is during formatting. To format included files, paste each file separately into this tool.
Does it support the stream {} block for TCP/UDP proxying?
Yes. The formatter handles stream blocks, mail blocks, and any other top-level NGINX block type using the same indentation rules.
How do I test the formatted config before deploying?
After formatting, replace your nginx.conf and run: sudo nginx -t && sudo nginx -s reload. The -t flag validates syntax without reloading the server.
このツールの問題を報告