ngx_http_stub_status_module
Basic connection and request counters on a status page
Overview
ngx_http_stub_status_module provides access to basic status information. A location carrying the stub_status directive returns a small plain text page with the number of active connections, the totals of accepted and handled connections and requests, and how many connections are currently reading, writing or waiting.
accepts and handled are normally equal unless a resource limit such as worker_connections was reached. The same numbers are available as the $connections_active, $connections_reading, $connections_writing and $connections_waiting variables (1.3.14). Before 1.7.5 the directive required an arbitrary argument such as stub_status on.
It is an official nginx module and is not built by default upstream, so it needs the --with-http_stub_status_module configure parameter. It is the usual data source for monitoring agents and Prometheus exporters, normally restricted to localhost or a monitoring network.
Key directives
stub_statusServes the basic status page from the surrounding location; server or location context, no arguments since 1.7.5.Active connectionsCurrent number of active client connections, including Waiting connections.accepts, handled, requestsTotals of accepted connections, handled connections and client requests since start.Reading, Writing, WaitingConnections currently reading a request header, writing a response, or idle waiting for a request.$connections_activeVariable equal to the Active connections value; reading, writing and waiting variants also exist (1.3.14).Example
Availability
Compiled into every n.wtf nginx binary. Install nginx-extras and the directives above work out of the box, no load_module line needed.