Nginx Config Auditor

Your nginx.conf decides what attackers learn about your server and how hard TLS fights back. Read it before they do.

An nginx config audit is a static review of an nginx.conf file — its TLS settings, headers, exposure switches and proxy rules — checked line by line against known-good practice, without running the server. Paste yours here and this auditor reads it in your browser — never uploaded — and flags old TLS versions, weak ciphers, server_tokens left on, missing security headers, the add_header inheritance trap, autoindex on, missing gzip types and incomplete proxy headers, with a 0–100 score. The companion article nginx config audit guide explains each check. Also see the SSH Server Config Auditor and the systemd Unit Auditor.

Last updated:

1. Audit a config

Drop an nginx config here, or choose one below

An nginx.conf, a site file from sites-available, or any fragment in the same syntax. Up to 1 MB — parsed in your browser.

🔒 The audit runs entirely in your browser: the config is never uploaded, never stored, and never sent anywhere. A config names certificate paths, internal upstreams and access rules — that is exactly why it stays on your machine.

What an nginx config is

An nginx config is a tree of blocks and directives: a main context sets worker_processes, an events block sets worker_connections, and an http block holds server blocks — one per site — which hold location blocks per URL path, plus upstream blocks naming backend servers. Directives end with ;, blocks open with {, and # starts a comment.

Most directives inherit: a value set in http applies to every server inside it unless the server overrides it, and a server value flows into its locations. That inheritance is what makes a small file powerful — and what makes add_header dangerous, because it is the famous exception: the moment a location defines any add_header of its own, it inherits none of the parent’s headers.

TLS lives in a handful of directives: ssl_protocols picks the protocol versions, ssl_ciphers the cipher list, ssl_prefer_server_ciphers decides whose preference wins, and ssl_session_tickets controls session resumption keys. Together with the listen … ssl line and the http2 on; directive, they are the whole transport-security posture of the site — which is why this auditor weights them heavily.

A config also decides what the server reveals and serves by default: server_tokens prints the nginx version in error pages and the Server header, autoindex on turns a directory into a browsable listing, and a missing default_server catch-all means unknown Host headers land on your first real site instead of being dropped with a 444.

What this auditor does — and what it does not

It parses the config in your browser — blocks, directives, comments and quoted strings — and runs 30 rules over the tree: TLS versions and ciphers, server_tokens, the three baseline security headers, the add_header inheritance trap, autoindex, body-size and timeout settings, gzip coverage, proxy headers and WebSocket upgrade headers, if inside locations, admin locations without a guard, logging switched off, and more. Scoring starts at 100; each error deducts 10 (capped at 50), each warning 4 (capped at 28), each info 1 (capped at 10). Bands: 90+ Excellent, 70–89 Good, 50–69 Needs work, below 50 Poor.

It does not run nginx, follow include lines, open your certificate files, or test a live server: it reads exactly the text you give it. A finding is a pattern, not a verdict — proxy_pass to a plain http:// upstream on the same machine is normal, and a huge client_max_body_size may be exactly what an upload service needs. Read each finding with its evidence and decide with your context.

The broken demo is a small site config built to trip the rules on purpose — TLSv1 and SSLv3 enabled, RC4 ciphers, server_tokens on, no security headers, gzip off, logging off, an if in a location and an unguarded /admin — and scores 32 (Poor). The hardened demo is the same shape with every finding fixed, and scores 100.

Be honest about what a static audit cannot see

This audit reads text. It cannot see the certificate files the config points at (an expired or mismatched certificate passes every check here), the modules your nginx binary was compiled with, whether an upstream is actually healthy, or the firewall in front of the server. It also cannot see files pulled in by include — audit those separately, because a clean main file can include a broken site file.

And a high score is not a safe server. The rules encode widely agreed practice — the nginx documentation and the Mozilla SSL Configuration Generator — but they are a checklist, not a penetration test. “No findings” means no risky pattern was found in this text — not that the server behind it is secure.

Key facts

server_tokensWhen on (the default), nginx prints its version number in error pages and the Server response header — free reconnaissance for an attacker choosing an exploit.
add_header inheritanceadd_header is inherited from the parent block only if the current block defines no add_header of its own. One header in a location silently drops every parent header — HSTS included.
ssl_protocolsThe TLS versions nginx will negotiate. TLSv1 and TLSv1.1 are deprecated (RFC 8996); a modern config offers TLSv1.2 and TLSv1.3 only.
444A non-standard nginx return code that closes the connection without responding. Used on a default_server catch-all to drop requests for unknown hostnames.
if is evilThe nginx documentation’s own warning: if inside a location behaves unpredictably in several common patterns. The safe uses are essentially return and rewrite … last.
autoindexWhen on, a request for a directory without an index file returns a browsable listing of every file in it — backups, configs and all.
HSTSThe Strict-Transport-Security header tells browsers to only ever use HTTPS for the site. It only counts when sent from the HTTPS server itself.
Format referencengx_http_core_module — nginx documentation

Frequently asked questions

Why does the audit run in my browser instead of on a server?

Because a config can name things you do not publish: certificate and key paths, internal upstream addresses, allow-lists for admin paths. Sending that to a server to audit it would create the exact exposure the audit is meant to catch. Parsing it locally means the config never leaves your machine.

My config has findings — is my server unsafe?

Not necessarily. A finding is a pattern that matched, and some matches are intended: a large client_max_body_size on an upload service, proxy_pass to http:// on the same host. Start with the errors — old TLS versions, weak ciphers, autoindex on — then the warnings, and treat the infos as a checklist of defaults worth setting explicitly.

What can this audit not check?

Anything outside the pasted text: the certificate files themselves, included files (include lines are noted, not followed), compiled-in modules, upstream health, and whether the running server actually loaded this config. Run nginx -t and nginx -T on the server for the full picture — this tool is the fast first pass over the text.