In this tutorial, I will show you how to add Nginx status page.

We have to check first whether with-http_stub_status_module module is compiled on Nginx or not by using the following command:

nginx -V 2>&1 | grep -o with-http_stub_status_module

If you see following result:

 Enable Nginx Status Page


It means we can go to next step.

Add following code inside your Nginx server {.....} block:

1
2
3
4
5
6
location /status {
    stub_status on;
    access_log off;
    allow 192.168.1.100;
    deny all;
}

allow 192.168.1.100 means the status page can be accessed only from 192.168.1.100. So, you have to change it with your IP Address.

Don’t forget to restart your Nginx by using this command:

service nginx restart

Then access http://your-nginx-address/status, you will see result like the picture below.

 Enable Nginx Status Page