NGINX
$ nginx Official Med RiskThe nginx binary runs and controls the NGINX HTTP reverse proxy, load balancer, and static web server. While nginx -t and -T give reliable exit-code validation and full config dumps, the CLI lacks JSON output, requires root/elevated permissions on standard ports, and emits diagnostics to stderr.
brew install nginx Host-level daemon control binary (-t, -s reload); cannot be operated sensibly over a remote MCP tool.
Agent-Readiness Checklist
Local Probe EvidenceCaptured --help excerpt
nginx: invalid option: "-"
FCRS-1.0 6-Dimension Breakdown
Non-interactive flags (-t, -T, -s reload) with deterministic exit codes, but zero JSON output, single-letter POSIX flags, and human-oriented stderr messages.
- Deterministic exit code on
nginx -tand-Tconfig dump - No JSON output; writes status lines to
stderr
nginx -t tests configuration safely without touching live traffic, though -s stop/reload affects live server processes and often requires sudo.
- Safe pre-flight validation via
nginx -t - Daemon signals (
-s stop/reload) affect live traffic
Ubiquitous via Homebrew, apt/dnf, Docker, and official binaries across macOS, Linux, and Windows (Windows support is limited/legacy).
- Pre-packaged across virtually all Unix distros and Homebrew
nginx -T gives agents the complete expanded configuration across conf.d/* includes in one command.
- Industry-standard reverse proxy with
nginx -Tfull-config dump
Official F5 NGINX repository (nginx/nginx) under BSD-2-Clause.
- Official
nginx/nginxcodebase under BSD-2-Clause
Comprehensive directive and CLI switch reference at nginx.org/en/docs/.
- Official command-line switches and directive reference at nginx.org
Security, Auth & Guardrails
Uses local filesystem config (nginx.conf), TLS private keys, and optional htpasswd files; no interactive login.
BSD-2-Clause open-source; completely free (commercial NGINX Plus is a separate product).
# NGINX Agent Rules - Always run `nginx -t` before executing `nginx -s reload`. - Remember `nginx -t` writes diagnostic output to `stderr` even on success. - Never run `nginx -s stop` in production without user approval; prefer `-s reload` after testing.
Agent-Ready Command Recipes
Safe Read-Only Queries
nginx -t
Validates nginx.conf and included files without starting or reloading the running daemon.
nginx -T
Runs syntax test and prints all included configuration files to stdout for agent inspection.
Controlled Writes & Previews
nginx -s reload
Signals the master process to reload configuration gracefully after nginx -t succeeds.
Strengths for Agents
- +
nginx -treliably validates config syntax and file paths before reload. - +
nginx -Tdumps the entire resolved configuration tree for quick inspection. - + Zero interactive prompts and ubiquitous package availability.
Caveats & Pitfalls
- ! No JSON output format; diagnostic messages go to
stderr. - ! Daemon lifecycle operations typically require elevated privileges and have no
--dry-runbeyond-t.