Admin-Ahead Community

General Category => General Discussion => Topic started by: Vinil on January 03, 2014, 08:04:22 pm

Title: How to see active connections of your Nginx server via browser
Post by: Vinil on January 03, 2014, 08:04:22 pm
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:



Configuration

Edit nginx.conf file:

Quote
# vi nginx.conf

Add or append the following :


Quote
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:

Quote
# service nginx reload


Test it

Open a web-browser and type the following url:

http://Your-IP-OR-Domain-Name/nginx_status


You can see a sample output from the below screenshot:

(http://s0.cyberciti.org/uploads/faq/2013/02/nginx_status_output.png)