How to See Active Connections and Connections per Second on Nginx

Valic —  March 11, 2013 — Leave a comment

If you want to monitor your Nginx server status and all connections per second just like Apache mod_status unde Debian or any Linux/Unix distribution follow this tutorial.

By default, Nginx web server comes with a module called  HttpStubStatusModule that provides information on Nginx active connections, connections per second and other.

This tutorial will show you how to enable this feature in Debian Squeeze:

1. Configure Ngins Status:

First, open the nginx.conf file. On Debian, this is located under the /etc/nginx directory.

# vi nginx.conf

Then add the followings in context location or under every virtualhost that you have configured:

location /nginx_status {
#This turn on stats
stub_status on;
access_log off;
#You can allow only from your home IP address or from any location
allow; #Let's day that this is your IP
#Uncomment the next line if you want to allow access to this from anywhere
#allow all;
deny all;

2. Save and close the file and reload nginx server:

/etc/init.d/nginx restart
[ ok ] Restarting nginx: nginx.


service nginx restart
[ ok ] Restarting nginx: nginx.

3. Test the Nginx_status:

Open you favorite web browser  and type the following url:


You should see something like this:

Active connections: 113
server accepts handled requests
1169 1169 1111
Reading: 86 Writing: 27 Waiting: 0



Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

No Comments

Be the first to start the conversation.

Leave a Reply