nginx 1.31.5 control API returns HTTP 422 on failed reload instead of a log line
nginx 1.31.5 added a control API that reloads configuration over HTTP and returns a structured response instead of an error-log line. A bad config now yields HTTP 422 with the exact compiler message in JSON, but the API is no faster than nginx -s reload and has no authentication of its own.
- Control API is enabled with the -l unix:/tmp/nginx_control.sock flag, not a config directive
- PATCH /1/control/config returns HTTP 422 with the error text in JSON on failure
- API reload is not faster than nginx -s reload: 90–102 ms vs 78–100 ms
- Bound to a TCP port, the unauthenticated API exposes PIDs and allows config swaps
Read next
AI