Nginx Config Formatter
Format and indent nginx configuration files with properly nested blocks.
$nginx config
0 chars1 lines
$formatted config[READY]
0 chars1 lines
Related Tools
YMLYAML Formatter
Format and beautify YAML with consistent indentation (2 or 4 spaces).
INIINI File Formatter
Format INI and .properties files with consistent spacing and section headers.
DOCKDockerfile Generator
Generate a production-ready multi-stage Dockerfile by selecting base image, port, and entry command.
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.
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.