FeaturesWP CloudPricingEE CLIContactMy Account

Features

Team Access & User Permissions

Server Setup & Management

Site Creation & Management

Deployments & Developer Tools

Firewall Protection

Speed & Caching

Backups & Recovery

Logs & Monitoring

Create WP Cloud Sites

All Features

Read Documentation

Install

Installation Guide

FAQ

Roadmap

Explore EE CLI

Resources

Commands

Handbook

Blog

Community

Forum

EasyExperts

Tutorials

Subscribe

Github

CLEAR

Start For Free

separator Tutorials separator Nginx separator Enable Nginx Status Page

Topics

On this page

Requirement

Nginx Config

Output:

Interpretation

Enable Nginx Status Page

Nginx status page can give realtime data about Nginx’s health. It can help you tweak few Nginx config. Status data can be used in load-balancer env also.

Requirement

Nginx must be compiled with HttpStubStatusModule module. You can check that by running following command:


			nginx -V 2>&1 | grep -o with-http_stub_status_module
		

If you see following output, you are good to go ahead. Otherwise, refer this post to install nginx-full.


			with-http_stub_status_module
		

Nginx Config

You need to add following to a nginx site, say example.com, inside server {..} block.


			location /nginx_status {
          stub_status on;
          access_log   off;
          allow 1.1.1.1;
          deny all;
        }
		

Make sure you replace 1.1.1.1 with your machine’s IP-address. It’s good idea to keep this page accessible to only you.

Output:

Once you codes and reload nginx config, just visit: http://example.com/nginx_status You will see output like below:


			Active connections: 43 
server accepts handled requests
 7368 7368 10993 
Reading: 0 Writing: 5 Waiting: 38
		

Interpretation

Website access restriction using nginx

PREVIOUS

Forwarding Visitor's Real-IP + Nginx Proxy/Fastcgi backend correctly

NEXT


Comments

  1. Phillip Wilhelm Avatar

    Phillip Wilhelm

    September 24, 2013

    By adding this /nginx_status to a server block would it only show data for that site or for the entire server?

    1. Rahul Bansal Avatar

      Rahul Bansal

      September 25, 2013

      You will get stats for entire Nginx server running that site.

  2. Steven Avatar

    Steven

    December 10, 2013

    Can this be used with Nginx as a reverse proxy? If so, where to enable?

    1. Rahul Bansal Avatar

      Rahul Bansal

      December 11, 2013

      Yep.

      About “where” – if you want to monitor nginx@proxy, copy-paste above config in nginx@proxy.

      If you want to monitor nginx@backend, then copy-paste above config in nginx@backend.

      You can also monitor both using different location like `/nginx_status_proxy` and `/nginx_status_backend`.

  3. deprito Avatar

    deprito

    December 20, 2013

    I’m using easy engine.
    I try this tutorial to view nginx_status on my site.
    But it turns to forbidden. I disable security by comment on ‘allow ip.add.re.ss
    But it same.. I got 403 forbidden when i trying access from my site.

    What must i do to enable it and turn into 200 response. not 403.
    Thanks 🙂

    1. Rahul Bansal Avatar

      Rahul Bansal

      December 20, 2013

      You need to comment out deny all line.

  4. A.Er Avatar

    A.Er

    March 14, 2014

    Compiled and used the added the line to the /sites-enabled/domain.com. Entered the correct ip number too.

    But I’m getting a 404 error. All of my site is https. Could this be the problem?

    1. Rahul Bansal Avatar

      Rahul Bansal

      March 14, 2014

      404 should not be related to https.

      Does it work without https?

Features

Useful Links

Product

Other Products

Subscribe for curated product updates, tips, and announcements.

"*" indicates required fields

Email

This field is for validation purposes and should be left unchanged.

Email*

SIGN ME UP

Δ


© rtCamp, since 2009. All rights reserved.

Powered by