We can monitor a nginx server status and connections requests per seconds under a linux or unix like operating systems. Nginx server has a module called
HttpStubStatusModule. This module provides the ability to get following status from nginx:
- Number of all open connections.
- Stats about accepted connections.
- Connections per second and so on.
ConfigurationEdit nginx.conf file:
# vi nginx.conf
Add or append the following :
location /nginx_status {
# Turn on stats
stub_status on;
access_log off;
# only allow access from 192.168.1.5 #
allow 192.168.1.5;
deny all;
}
You must replace the IP 192.168.1.5 with your local end IP.
Save and close the file. Reload nginx server:
# service nginx reload
Test itOpen a web-browser and type the following url:
http://Your-IP-OR-Domain-Name/nginx_statusYou can see a sample output from the below screenshot: