NGINX CONFIG SECURITY CHECK · RUNS IN YOUR BROWSER

Is your nginx config handing out files, headers or your internal network?

nginx accepts a missing slash, a $uri where $request_uri belonged, or one add_header in a location without a word of warning, and each one quietly opens a hole: a path above your static folder, injected response headers, security headers that stop being sent. Paste your config and its includes below and this page lists each risky setting with its file, line and fix.

Nothing is uploaded. What you paste is read in this browser and never leaves your device, and the tool makes no network calls of its own. It reads the files, not a running server: it is not nginx -t and not a security audit.

1. Paste your config

Name each block like its path. include conf.d/*.conf; in one block pulls in every block whose name ends in conf.d/something.conf, in name order, the way nginx does.

Paste at least one nginx config file above and click Check.

What it checks

Several of these were first catalogued by Yandex's Gixy, a Python analyser; this is an independent implementation and is not affiliated with it. Every type, with the nginx behaviour behind it: nginx misconfigurations explained.

Prefer a CLI, or want this in your own CI?

Same engine, zero dependencies, Node 18 or later:

node check.mjs /etc/nginx/             # a whole config tree, includes resolved
node check.mjs site.conf --format json  # machine-readable
node check.mjs . --fail-on-risk         # exit 2 on any high or medium finding

Get check.mjs and scan.mjs from the repo: nothing to install, no network calls, and it never runs nginx.

Common questions

Why does my add_header not work inside a location block?

It does, but it switches off the others. The nginx documentation says add_header directives are inherited from the previous configuration level if and only if there are no add_header directives on the current level. So one add_header in a location drops every header set in server or http for that location, such as Strict-Transport-Security or X-Frame-Options. Repeat them in the location (an include file keeps them in one place) or, on nginx 1.29.3 or later, set add_header_inherit merge; at the top.

What is the nginx alias off-by-slash vulnerability?

A prefix location without a trailing slash, such as location /img, with an alias that has one, such as alias /data/img/, lets a request for /img../ map to /data/img/../, the directory above. Make the two agree: location /img/ with alias /data/img/.

Why is $uri dangerous in an nginx redirect?

$uri holds the normalised, decoded path, so an encoded line break (%0d%0a) in the request becomes a real line break in the Location header, and an attacker can add headers of their own. $request_uri keeps the client's original encoding: return 301 https://$host$request_uri;

Is this the same as nginx -t?

No. nginx -t checks that nginx will accept the configuration. This tool reads the files for risky settings that nginx accepts without complaint, and it works on files in a repository or an image before they reach a server. Run both.

Does a clean result mean my nginx server is secure?

No. It reads only the patterns listed on this page, does not know your nginx version, does not follow map, geo or set values, and cannot see the application behind proxy_pass. Have a qualified person review anything that protects valuable data.