=encoding utf-8 =head1 NAME ngx_http_status_module - Module ngx_http_status_module =head1 The C module provides access to various status information. B This module is available as part of our commercial subscription. =head1 Example Configuration http { upstream backend { zone http_backend 64k; server backend1.example.com weight=5; server backend2.example.com; } proxy_cache_path /data/nginx/cache_backend keys_zone=cache_backend:10m; server { server_name backend.example.com; location / { proxy_pass http://backend; proxy_cache cache_backend; health_check; } status_zone server_backend; } server { listen 127.0.0.1; location /upstream_conf { upstream_conf; } location /status { status; } location = /status.html { } } } stream { upstream backend { zone stream_backend 64k; server backend1.example.com:12345 weight=5; server backend2.example.com:12345; } server { listen 127.0.0.1:12345; proxy_pass backend; status_zone server_backend; health_check; } } Examples of status requests with this configuration: http://127.0.0.1/status http://127.0.0.1/status/nginx_version http://127.0.0.1/status/caches/cache_backend http://127.0.0.1/status/upstreams http://127.0.0.1/status/upstreams/backend http://127.0.0.1/status/upstreams/backend/peers/1 http://127.0.0.1/status/upstreams/backend/peers/1/weight http://127.0.0.1/status/stream http://127.0.0.1/status/stream/upstreams http://127.0.0.1/status/stream/upstreams/backend http://127.0.0.1/status/stream/upstreams/backend/peers/1 http://127.0.0.1/status/stream/upstreams/backend/peers/1/weight The simple monitoring page is shipped with this distribution, accessible as “Cstatus.html>” in the default configuration. It requires the locations “Cstatus>” and “Cstatus.html>” to be configured as shown above. =head1 Directives =head2 status B I The status information will be accessible from the surrounding location. Access to this location should be L. =head2 status_format B status_format I> B status_format I [I>]> B I B I B I B I By default, status information is output in the JSON format. Alternatively, data may be output as JSONP. The I> parameter specifies the name of a callback function. The value can contain variables. If parameter is omitted, or the computed value is an empty string, then “C” is used. =head2 status_zone B status_zone I>> B I Enables collection of virtual L or L (1.7.11) server status information in the specified I>. Several servers may share the same zone. =head1 Data The following status information is provided: =over =item C Version of the provided data set. The current version is 6. =item C Version of nginx. =item C
The address of the server that accepted status request. =item C The total number of configuration L. =item C Time of the last reload of configuration, in milliseconds since Epoch. =item C Current time in milliseconds since Epoch. =item C The ID of the worker process that handled status request. =item C =over =item C The total number of abnormally terminated and respawned child processes. =back =item C =over =item C The total number of accepted client connections. =item C The total number of dropped client connections. =item C The current number of active client connections. =item C The current number of idle client connections. =back =item C =over =item C The total number of successful SSL handshakes. =item C The total number of failed SSL handshakes. =item C The total number of session reuses during SSL handshake. =back =item C =over =item C The total number of client requests. =item C The current number of client requests. =back =item C For each L: =over =item C The number of client requests that are currently being processed. =item C The total number of client requests received from clients. =item C =over =item C The total number of responses sent to clients. =item C<1xx>, C<2xx>, C<3xx>, C<4xx>, C<5xx> The number of responses with status codes 1xx, 2xx, 3xx, 4xx, and 5xx. =back =item C The total number of requests completed without sending a response. =item C The total number of bytes received from clients. =item C The total number of bytes sent to clients. =back =item C For each L L, the following data are provided: =over =item C For each L, the following data are provided: =over =item C The ID of the server. =item C An L of the server. =item C A boolean value indicating whether the server is a L server. =item C L of the server. =item C Current state, which may be one of “C”, “C”, “C”, “C”, or “C”. =item C The current number of active connections. =item C The L limit for the server. =item C The total number of client requests forwarded to this server. =item C =over =item C The total number of responses obtained from this server. =item C<1xx>, C<2xx>, C<3xx>, C<4xx>, C<5xx> The number of responses with status codes 1xx, 2xx, 3xx, 4xx, and 5xx. =back =item C The total number of bytes sent to this server. =item C The total number of bytes received from this server. =item C The total number of unsuccessful attempts to communicate with the server. =item C How many times the server became unavailable for client requests (state “C”) due to the number of unsuccessful attempts reaching the L threshold. =item C =over =item C The total number of L requests made. =item C The number of failed health checks. =item C How many times the server became unhealthy (state “C”). =item C Boolean indicating if the last health check request was successful and passed L. =back =item C Total time the server was in the “C” and “C” states. =item C The time (in milliseconds since Epoch) when the server became “C” or “C”. =item C The time (in milliseconds since Epoch) when the server was last selected to process a request (1.7.5). =item C The average time to get the L from the server (1.7.10). The field is available when using the L load balancing method. =item C The average time to get the L from the server (1.7.10). The field is available when using the L load balancing method. =back =item C The current number of idle L connections. =item C For the requests L, the following data are provided: =over =item C The current number of requests in the queue. =item C The maximum number of requests that can be in the queue at the same time. =item C The total number of requests rejected due to the queue overflow. =back =back =item C For each cache (configured by L and the likes): =over =item C The current size of the cache. =item C The limit on the maximum size of the cache specified in the configuration. =item C A boolean value indicating whether the “cache loader” process is still loading data from disk into the cache. =item C, C, C, C =over =item C The total number of responses read from the cache (hits, or stale responses due to L and the likes). =item C The total number of bytes read from the cache. =back =item C, C, C =over =item C The total number of responses not taken from the cache (misses, expires, or bypasses due to L and the likes). =item C The total number of bytes read from the proxied server. =item C The total number of responses written to the cache. =item C The total number of bytes written to the cache. =back =back =item C =over =item C For each L: =over =item C The number of client connections that are currently being processed. =item C The total number of connections accepted from clients. =item C The total number of bytes received from clients. =item C The total number of bytes sent to clients. =back =item C For each L L, the following data are provided: =over =item C For each L the following data are provided: =over =item C The ID of the server. =item C An L of the server. =item C A boolean value indicating whether the server is a L server. =item C L of the server. =item C Current state, which may be one of “C”, “C”, “C”, or “C”. =item C The current number of connections. =item C The total number of client connections forwarded to this server. =item C The average time to connect to the upstream server. The field is available when using the L load balancing method. =item C The average time to receive the first byte of data. The field is available when using the L load balancing method. =item C The average time to receive the last byte of data. The field is available when using the L load balancing method. =item C The total number of bytes sent to this server. =item C The total number of bytes received from this server. =item C The total number of unsuccessful attempts to communicate with the server. =item C How many times the server became unavailable for client connections (state “C”) due to the number of unsuccessful attempts reaching the L threshold. =item C =over =item C The total number of L requests made. =item C The number of failed health checks. =item C How many times the server became unhealthy (state “C”). =item C Boolean indicating if the last health check request was successful and passed L. =back =item C Total time the server was in the “C” and “C” states. =item C The time (in milliseconds since Epoch) when the server became “C” or “C”. =item C The time (in milliseconds since Epoch) when the server was last selected to process a connection. =back =back =back =back =head1 Compatibility =over =item * The L status data were added in L 6. =item * The L field in L was added in L 6. =item * The L status data were added in L 6. =item * The L field was added in L 6. =item * The list of servers in L was moved into L in L 6. =item * The C field of an upstream server was removed in L 5. =item * The stream status data were added in L 5. =item * The L field was added in L 5. =item * The L field in L was added in L 5. =item * The L and L fields in L were added in L 5. =item * The L field in L was added in L 4. =item * The draining state in L was added in L 4. =item * The L and L fields in L were added in L 3. =item * The C field in L was added in L 3. =item * The L, L, and L status data were added in L 2. =back