← ServerPilot Docs

How to Enable Nginx Stub Status Module

Careful, don't break your server!
You should first read the article on customizing Nginx.

To enable the HTTP Stub Status module for Nginx, create the file:

/etc/nginx-sp/vhosts.d/APPNAME.d/nginx_status.conf

with the following contents:

location /nginx_status {
  # copied from http://blog.kovyrin.net/2006/04/29/monitoring-nginx-with-rrdtool/
  stub_status   on;
  access_log    off;

  allow SOME.IP.ADD.RESS;
  deny all;
}

Replace SOME.IP.ADD.RESS with the IP address of the machine you'll be accessing this page with.

Then, restart Nginx by running this command as root:

sudo service nginx-sp restart

You can find more information in the Nginx documentation for the allow directive and the HttpStubStatusModule.

If you're making status requests from within your server and are using localhost or 127.0.0.1 for the domain name in the request, be sure to add localhost or 127.0.0.1 as a domain name for your app. Otherwise, the request will be denied.
Last updated: July 30, 2018

Launch your first site in 5 minutes