Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: How to see active connections of your Nginx server via browser  (Read 3412 times)

0 Members and 1 Guest are viewing this topic.

Vinil

  • Guest
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.


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: