Free Tool

Is That Server Block Doing What You Think?

Paste a server block. The auditor reads it in your browser, checks the proxy headers, the WebSocket setup, the TLS settings, and the response headers — and tells you which ones silently stopped working because of an inheritance rule. It never uploads the paste.

Every verdict names the directive and the nginx.org page it rests on. Where the answer depends on the nginx version or on text outside the paste, the auditor says so instead of guessing.

Audit your server block

Paste one server { } block below. The auditor parses server and location scope separately and applies the inheritance rules to each location, so a header set at server level and dropped in one location shows up as dropped — not as present.

Or load a sample:

What the auditor checks

Proxy headers (PH-1 to PH-4). The four headers a reverse proxy usually forwards — Host, X-Real-IP, X-Forwarded-For, X-Forwarded-Proto — are checked per location, after inheritance. Host $host passes: $host is the host name from the request line or the Host header, falling back to the primary server name when the client sent none. Host $http_host warns: it passes nothing when the client sent no Host header. No Host at all warns too, because the upstream then receives the default, Host $proxy_host — the name from the proxy_pass URL, not the name the client asked for. X-Forwarded-Proto $scheme passes; $scheme is http or https, and without it the upstream cannot tell which one the client used, which is the usual cause of redirect loops behind a proxy.

WebSocket (WS-1 to WS-4). Only checked when you tick "This server proxies WebSockets", because the auditor cannot know from the text whether a location is meant to carry WebSockets. Upgrade and Connection are hop-by-hop headers, so nginx does not pass them to the upstream unless they are set explicitly: the reference sets proxy_set_header Upgrade $http_upgrade and proxy_set_header Connection "upgrade", or $connection_upgrade from the http-context map. The idle timeout is the 60-second proxy_read_timeout default — the reference notes the connection closes if the proxied server sends nothing within 60 seconds — so a WebSocket location with no timeout set gets an information note, not a failure.

TLS (TLS-1 to TLS-3). A server that listens on 443 with ssl must have both ssl_certificate and ssl_certificate_key; without either, the handshake cannot complete. ssl_protocols fails when it re-enables SSLv2, SSLv3, TLSv1, or TLSv1.1 — the default is TLSv1.2 and TLSv1.3, and TLSv1 and TLSv1.1 have been disabled by default since 1.27.3. A proxy_pass to an https:// upstream with proxy_ssl_verify off warns: verification is off by default, so nginx accepts any certificate the upstream presents.

Response headers (HSTS-1 to HSTS-3). HSTS is checked only on a server that listens on 443 with ssl: on a port-80-only server it warns, because browsers ignore the header over plain HTTP. An add_header without always is flagged as information: without always the header is added only for a listed set of response codes, so error responses go out without it.

The version that changed the default

The proxy_http_version verdict is the one that depends on the nginx version, and the auditor does not pick a side for you.

Before 1.29.7, the default was 1.0. Since 1.29.7, the default is 1.1 — the 1.29.7 changelog says so in one line: "now ngx_http_proxy_module supports keepalive by default; the default value for proxy_http_version is 1.1; the Connection proxy header is not sent by default anymore." The proxy module reference says the same thing in the proxy_http_version section. The WebSocket proxying doc still carries the comment # proxy_http_version 1.1; # before version 1.29.7 in its example.

So the rule is: on nginx 1.29.7 or newer, an explicit proxy_http_version 1.1; is harmless but not needed. On anything older, a WebSocket location without it fails, because 1.0 cannot carry the protocol switch. If you do not know the version, the auditor says so and tells you to set 1.1 explicitly — it is correct on both.

The inheritance trap

Two directives share the same all-or-nothing rule, and both are the reason this auditor parses scope instead of grepping text.

proxy_set_header. The proxy module reference states it plainly: these directives "are inherited from the previous configuration level if and only if there are no proxy_set_header directives defined on the current level." One proxy_set_header in a location silently drops every server-level one. The location then sends only what it sets itself, plus the defaults (Host $proxy_host and Connection close). Load the "inheritance trap" sample above to see it fire: the /api/ location sets only Host $host, and the server-level X-Real-IP, X-Forwarded-For, and X-Forwarded-Proto stop reaching the upstream for that location.

add_header. The headers module reference states the identical rule for add_header: inherited "if and only if there are no add_header directives defined on the current level." One add_header in a location — even on a static-files location that serves no proxy traffic — drops the server-level HSTS header for requests to that location. The same sample shows it: the /assets/ location sets one X-Content-Type-Options header and loses the server-level Strict-Transport-Security line. Since 1.29.3, add_header_inherit merge restores the merge; the auditor recognizes it.

What this page cannot check

Anything in the http context. The WebSocket $connection_upgrade map lives in http, outside any server block. A server-block-only paste cannot show it, so the auditor reports that verdict as uncheckable instead of assuming the map exists. If a location uses $connection_upgrade, paste the map block too — it should read map $http_upgrade $connection_upgrade { default upgrade; '' close; } — or check the http context yourself.

Anything in an included file. include lines are not resolved. If your block includes a snippet file, the verdicts cover only what is in the paste. Paste the included file's contents into the same block, or audit it separately.

Anything at runtime. TLS negotiation, whether the certificate files exist and match, and the headers a live server actually sends are all runtime facts. Check them with curl -I against the live host. And no result on this page means a config is "secure": static text cannot prove that. It can only show that the pasted text matches the documented rules.

Nearby tools that do similar jobs

This auditor is not the only tool in this space, and the differences matter. The dargslan nginx analyzer is a command-line tool that audits the config file on the machine it runs on — it reads the config file, not a paste. The SimpleMoney nginx security headers generator builds add_header lines from tick boxes; it writes config, it does not audit pasted config. The damonsec NGINX Config Analyzer is the closest match: a browser tool that pastes a config and runs 40-plus context-aware rules, including inheritance, WebSocket headers, and upstream keepalive, plus multi-file include resolution and a request-flow simulator this page does not have. What this page adds is narrower: one server block at a time, every verdict tied to the exact directive and nginx.org section it rests on, the version-gated proxy_http_version verdict, and an explicit "uncheckable from this paste" state instead of a silent pass.

Frequently asked questions

Does this page send my config anywhere? No. The auditor is client-side JavaScript. Your paste stays in your browser tab and is never uploaded, logged, or sent to any server.

Can the auditor tell me my config is secure? No. It reads pasted text and checks it against the documented rules. TLS negotiation, certificate files, and the headers a live server actually sends are runtime checks this page cannot run. A clean result here means the pasted text matches the documented rules, nothing more.

Why does one proxy_set_header in a location drop the server-level headers? Because the reference says so: proxy_set_header directives are inherited from the previous configuration level if and only if there are no proxy_set_header directives defined on the current level. One line in a location replaces the whole server-level set, and anything the location does not repeat falls back to the defaults, Host $proxy_host and Connection close.

Do I still need proxy_http_version 1.1 for WebSockets? It depends on the nginx version. Since 1.29.7 the default proxy_http_version is 1.1, so nothing needs setting. Before 1.29.7 the default was 1.0, and the location needs proxy_http_version 1.1; for the upgrade to work. The auditor asks which version you run and gives the verdict for that version.

My location sets Connection to $connection_upgrade but the auditor cannot check it. Why? The $connection_upgrade map lives in the http context, outside any server block. A server-block-only paste cannot show it, so the auditor reports that verdict as uncheckable from the paste instead of assuming the map exists. Paste the map block too, or check the http context yourself.

Sources

Keep Exploring