nginx

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) |
What the card shows
Section titled “What the card shows”- Version:
nginx -Vof 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.-Vprints 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 nolisten), 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 theserverblock starts). A row expands toroot,index, redirects and up to 60locationblocks with their file and line. - Upstreams (up to 100): name, file and line, servers.
- Files read: every file followed through
include.
How the configuration is read
Section titled “How the configuration is read”Passive, as the session’s user:
- The running master process is found in
/proc/<pid>/commandcmdline; only its-c,-pand binary path leave the host. - With the active probe only:
nginx -Vof a trusted binary, undertimeout 5. Without it the configuration path comes from-cof the master or the unit, else the first default path found. - The configuration is read by a shell reader that follows
include, undertimeout 20. A filter on the host prints only listed directives, with filtered fields: URLs without userinfo and query string, fromreturnthe code and, for 3xx, the URL. Nothing ofifconditions, headers,mapor 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
Section titled “Test config”
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.