Making use of the nginx http_stub_status_module

I recently installed Mail-in-a-Box (fantastic product) and have been playing around with it.

I’m looking at setting up remote monitoring for it (Nagios) and want to track some basic usage statistics via the nginx http_stub_status_module, which is included with the nginx packages.

In /etc/nginx/conf.d/local.conf I added the following:

    # Status page
    location /nginx_status {
            stub_status on;
            access_log off;
            allow; # home
            allow; # monitoring server
            allow; # grandma's house
            deny all;

Note: IPs are only an example. My grandmother doesn’t have an internet connection.

I placed it in the server section, just below the location /admin directive. Works like a charm.

Perhaps this can be included as an option in Mail-in-a-Box, configurable through the web UI (for restricting access by IP).

There is a hidden feature to insert arbitrary directives into the nginx config, but you’ll have to find it to use it. :slight_smile:

Where? Why hide it? :smiley:

This topic was automatically closed after 61 days. New replies are no longer allowed.