1. Check the nginx stub_status_module is enabled:

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

This should result in:


If not, install nginx with stub_status_module enabled.

2. Add the following code to the server block:

server {
listen 80 default_server;
# Define the document root of the server e.g /var/www/html
root /var/www/html;
location /nginx_status {
# Enable Nginx stats
stub_status on;
# Only allow access from your IP e.g or localhost #
# Other request should be denied
deny all;

*Set allow IP to the sources you need access from*

3. Browse to http(s)://example.com/nginx_status

Credit goes to – https://www.keycdn.com/support/nginx-status/

Written by Matt Cooper
Hi, I'm Matt Cooper. I started this blog to pretty much act as a brain dump area for things I learn from day to day. You can contact me at: matt@matthewc424.sg-host.com.