DevOps & Config

nginx Config Analyzer

Parse an nginx config, resolve its server and location blocks, and flag issues.

  • Draft kept in this tabYour draft is kept in this tab's session storage and cleared when the tab closes.
  • Runs in your browserProcessing happens in this page. No application server receives your input.

nginx configuration

Block structure

Targets
nginx 1.27
Servers
โ€”
Locations
โ€”
Upstreams
โ€”
Includes not followed
โ€”

Route tester

Locations

ServerModifierPatternHandlerPrecedence
No rows.

Findings

Findings are listed once the configuration has been read.

What This Tool Analyzes

Parses an nginx configuration into its block tree, lists every server and its location blocks, and evaluates which server and location block nginx 1.27 selects for a given URL along with the winning precedence step and candidate outcomes.

Target specification: nginx 1.27

Scope & Evaluation Limits

It does not follow include: every include is listed as a reference that was not resolved, and the header counts them, because a route decision made without conf.d/*.conf can be confidently wrong. Variables ($host, $1, a set directive) are shown as written and never interpolated, so a proxy_pass containing one is reported without a resolved target. The route tester models server selection and location precedence as documented in nginx 1.27; it does not model rewrite, try_files, if, or error_page re-entry, all of which can send a request somewhere else after a location is chosen: the tester says which location nginx enters, not where the request finally lands. Only the directive set below is validated for context; anything else is info. No module awareness: a directive from a third-party module reads as unknown.

  • Following include directives to external files
  • Runtime variable interpolation ($host, $1, set)
  • Post-location rewrite, try_files, if, or error_page re-entry

Lint Rules (10)

RuleSeverityFires when
NGINX/wrong-contexterrorA directive in a block it is not valid in โ€” location at http level, proxy_pass at server level
NGINX/duplicate-locationerrorTwo locations in one server with the same modifier and pattern. The second is unreachable
NGINX/proxy-no-host-headerwarningproxy_pass in a location with no proxy_set_header Host. The upstream sees nginx's own name and virtual hosting breaks
NGINX/proxy-no-forwarded-forwarningproxy_pass with no X-Forwarded-For or X-Real-IP. Every request reaches the app from the proxy's address
NGINX/ssl-protocols-oldwarningssl_protocols including SSLv3, TLSv1, or TLSv1.1
NGINX/root-in-locationwarningroot inside a location that also has an alias, or a root whose path ends with the location prefix โ€” the classic double-path 404
NGINX/alias-no-slashwarningAn alias whose trailing slash does not agree with its location's. The documented path-traversal footgun
NGINX/no-server-tokens-offinfoserver_tokens not set to off at any level
NGINX/server-name-underscoreinfoserver_name _;, which is not a wildcard โ€” it is an invalid name that can never match, used deliberately as a catch-all only in combination with default_server
NGINX/include-not-followedinfoOne per include, so the count in the header has rows behind it

Scope: this covers the page itself. Your browser, operating system, clipboard, downloads, extensions, and crash recovery may keep copies, and a compromised site origin would not be protected.