Skip to main content
nginx.conf static analysis

Nginx Config Linter & Syntax Checker

Paste your nginx.conf and get instant, line-by-line findings: unbalanced braces, missing semicolons, directive typos with fix suggestions, illegal nesting, and risky patterns like if inside location or the alias trailing-slash bug.

100% client-side config never leaves your browser no signup line numbers + severity
nginx.conf input
findings

What the linter checks

Around thirty heuristic rules across three groups. Errors would fail nginx -t; warnings are likely bugs or security smells; info notes are worth knowing.

ERROR Unbalanced braces

Unclosed { blocks and stray } — with recovery so the rest of your config is still analyzed.

ERROR Missing semicolons

Simple directives never terminated with ;, reported at the exact line, without false positives on multi-line directives.

ERROR Illegal nesting & context

server inside location, upstream inside server, listen outside server, worker_connections outside events, alias outside location and more.

ERROR Directive typos

Unknown directives are spell-checked against 150+ real nginx directives — server_names suggests server_name. Genuinely unknown names stay a warning (they may be third-party modules).

ERROR Alias path traversal

location /static/ paired with alias /var/www/static (missing trailing slash) lets requests escape the intended directory.

ERROR Bad location patterns

Invalid modifiers (= ~ ~* ^~ are the only ones), missing match patterns, malformed if conditions.

WARN if inside location

The famous “if is evil”: content handlers inside or around if execute in surprising order. Only return/rewrite/set is the safe subset.

WARN listen 443 without ssl

Binding port 443 without the ssl parameter means TLS is never negotiated. Also flags the deprecated ssl on;.

WARN Duplicate single-value directives

Two root or two server_name lines in one block — nginx rejects duplicates of single-value directives.

WARN add_header redefinition

add_header in a location replaces every header inherited from the server block instead of merging — headers silently vanish.

WARN proxy_pass pitfalls

Variables in proxy_pass without a resolver; a URI path in proxy_pass inside a regex location (surprising replacement semantics).

WARN Host header spoofing

proxy_set_header Host $http_host; forwards the raw client header — $host is almost always what you want.

WARN $uri in redirects

return 301 …$uri can enable CRLF/header injection — use $request_uri instead.

WARN Unsafe defaults

server_tokens on (version disclosure), autoindex on (directory listing), allow without deny all, valid_referers none.

INFO Worth knowing

Missing events block, server block without listen, unanchored regex locations, named locations, and a reminder that include files are not resolved.

Honest limitations

  • Not a replacement for nginx -t. The real binary resolves every include, validates against your compiled modules, and evaluates variables at runtime. This tool is a heuristic pre-check — fast, but approximate.
  • include files are not resolved. Directives living in included files are not linted. For full coverage, paste the output of nginx -T (the merged dump) instead.
  • Unknown directives are warnings, not errors, because third-party modules (lua, headers-more, brotli …) add legitimate directives this tool cannot know about.

How it compares

Different tools answer different questions. Here is an honest map.

CapabilityThis linterGetPageSpeed checkerGixy (CLI)nginx -t
Runs 100% in your browserYesNo (server-side)No (local install)No (needs server)
Config leaves your machineNeverUploaded for analysisNever (runs locally)Never
Install / signup requiredNeitherNeitherpip installServer access
Typo suggestions for directivesYesNoNoNo
Missing semicolons, brace balanceYesYesSyntax onlyYes
Security-focused audit (SSRF, traversal…)Heuristic subsetGixy-poweredDeep (25+ plugins)None
Resolves include filesNoNoYesYes

Frequently asked questions

Need to generate redirects instead of linting?
Our companion tool builds copy-paste 301/302 redirect blocks for nginx.
Nginx Redirect Generator →

Free tool by NRTechStudio