nginx server has a module called HttpStubStatusModule. This module provides the ability to get some status from nginx. You will get the following information:
- Number of all open connections.
- Stats about accepted connections.
- Connections per second and so on.
Configuration
Edit nginx.conf file:
Add or append the following in context location:
# vi nginx.conf
Add or append the following in context location:
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; }
Save and close the file. Reload nginx server:
OR
# service nginx reload
OR
# nginx -s reload
Test it
Open a web-browser and type the following url:
OR
Sample outputs:
http://your-domain-name-here/nginx_status
OR
http://ip.address.here/nginx_status
Sample outputs:
Where,
- 586 = Number of all open connections
- 9582571 = Accepted connections
- 9582571 = Handled connections
- 21897888 = Handles requests
No comments:
Post a Comment