Skip to content

nginx

nginx card

Common parts of every card (states, backoff, Unit and ExecReload, Test config, manual commands) are described in Monitor window.

Detected by systemd unit nginx, or binary nginx
Read every 60 s while the Monitor window shows the tab
Active probe none: nginx open source does not report upstream health; only the configuration is shown
Test config nginx -t (on demand)
  • Version: nginx -V of the binary (version, OpenSSL it was built with, path) (only with the active probe: the passive read runs no binary of the service); the passive read shows the package version and nginx -V … runs only with the active probe. -V prints the build and exits before reading the configuration. The binary runs only when it is trusted; otherwise Version not read: KryoDesk did not run <path> (<reason>).
  • Configuration: the main file and where its path came from: -c of the running master process, -c of the systemd unit’s ExecStart (no running master), –conf-path of nginx -V, or default path (/etc/nginx/nginx.conf, /usr/local/nginx/conf/nginx.conf, /usr/local/etc/nginx/nginx.conf, /opt/nginx/conf/nginx.conf); and the prefix (-p).
  • Problems while reading the configuration: files that cannot be read (cannot read, missing, not reachable by this account, not read fully, not shown, not understood). These come from KryoDesk’s own reading of the files, not from nginx; nginx’s verdict comes from Test config.
  • Virtual hosts (up to 400; more are counted): Names (server_name), Listen (address, port, ssl, http2, quic, default_server; *:80 (no listen) when a server has no listen), Serves (root/alias, proxy_pass, fastcgi_pass, return), Certificate (ssl_certificate, from http when inherited, with its expiry from the TLS certificates card), File (file and line where the server block starts). A row expands to root, index, redirects and up to 60 location blocks with their file and line.
  • Upstreams (up to 100): name, file and line, servers.
  • Files read: every file followed through include.

Passive, as the session’s user:

  1. The running master process is found in /proc/<pid>/comm and cmdline; only its -c, -p and binary path leave the host.
  2. With the active probe only: nginx -V of a trusted binary, under timeout 5. Without it the configuration path comes from -c of the master or the unit, else the first default path found.
  3. The configuration is read by a shell reader that follows include, under timeout 20. A filter on the host prints only listed directives, with filtered fields: URLs without userinfo and query string, from return the code and, for 3xx, the URL. Nothing of if conditions, headers, map or Lua leaves the host. The section is limited to 192 KiB.

nginx -T is never used: it prints every secret of the configuration.

Test config plan

Runs nginx -t with the unit’s last -c and -p (as nginx parses options, the last one wins). Without -c in the unit: the -c of the running master by the last probe, otherwise nginx’s built-in --conf-path from nginx -V of the same binary (otherwise the ownership check uses /etc/nginx/nginx.conf). Global directives passed with -g are not read by KryoDesk (their text stays on the host), so the test runs without them.

What it does, as the card says: parses the whole configuration like a reload does; opens (and creates when missing) the log files, the pid file’s directory and the temporary and cache directories it names (*_temp_path, *_cache_path; as root it also changes their owner to the user of the configuration); writes its own messages to the error log; reads every certificate and key; resolves upstream host names in DNS; may bind the listen addresses; runs the initialization code of loaded modules (load_module, init_by_lua). It does not signal the running nginx.

The ownership check covers the binary, the main file and up to 50 included files of the last probe.

Output masking on the host: values in quotes and after password, passwd, pass, secret, key, token, auth, lua, traceback, cookie, proxy_set_header, add_header, more_set_headers, env. Lua code run by init_by_lua* may print any text: lines with lua or traceback are masked after the word, other lines of a multi-line Lua message are not.

As a non-root account nginx -t usually fails on the error log or pid file: the result is no permission (not a verdict on the configuration), with sudo nginx -t … to paste into the terminal.

Scroll or pinch to zoom · drag to move · double-click to zoom · Esc or click outside to close