O'Reilly logo

Mastering NGINX by Dimitri Aivaliotis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Stub Status module

NGINX provides an introspection module, which 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: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required