Using the Stub Status module
NGINX provides an introspection module that outputs certain statistics about how it is running. This module is called stub_status and is enabled with the --with-http_stub_status_module
configure flag.
To see the statistics produced by this module, the stub_status
directive needs to be set to on
. A separate location
directive should be created for this module so that an ACL may be applied:
location /nginx_status { stub_status on; access_log off; allow 127.0.0.1; deny all; }
Calling this URI from the localhost (for example, with curl http://localhost/nginx_status
) will show output similar to the following lines:
Active connections: 2532 server accepts handled requests 1476737983 1476737983 3553635810 Reading: 93 Writing: 13 Waiting: 2426
Here we see that there are 2,532 open connections, of which NGINX is currently reading the request header of 93, and 13 connections are in a state in which NGINX is either reading the request body, processing...