Enable Nginx Status Page
Nginx status is provided by http_stub_status module. To verify if your Nginx is installed with this module, run
1 |
nginx -V 2>&1 | grep -o with-http_stub_status_module |
If the result shows “with-http_stub_status_module”, you have the module installed.
To enbale stats edit nginx configuration file for your web site, add following code
1 2 3 |
location /nginx_status { stub_status; } |
To linmit access to this page, you can use allow
1 2 3 4 5 6 |
location /nginx_status { stub_status; allow 127.0.0.1; allow YOUR_IP_HERE; deny all; } |
Replace YOUR_IP_HERE with your actial IP address.
Restart nginx with
1 |
systemctl restart nginx |
Now you should be able to see nginx server stats at url
https//yourdomain.com/nginx_status
See Nginx