OPNsense Forum

Archive => 22.7 Legacy Series => Topic started by: itngo on August 25, 2022, 10:23:59 am

Title: NGINX Stub_Status?
Post by: itngo on August 25, 2022, 10:23:59 am
Hi,

is NGINX-Plugin STUB_STATUS Page enabled?
Want to monitor NGINX with ZABBIX, but unsure what to enable or configure in NGINX to get the Status-Page working.
Even no idea if it is already and where it might already listening?
Title: Re: NGINX Stub_Status?
Post by: Fright on August 25, 2022, 06:08:14 pm
Hi
yes, nginx built with --with-http_stub_status_module
can add location for status page and add stub_status; directive via _post hook
Title: Re: NGINX Stub_Status?
Post by: itngo on September 13, 2022, 11:34:16 am
Hi,

thank you for your reply.
Can you get a bit more in detail about the _post hook.
What exactly should the file look like?
Title: Re: NGINX Stub_Status?
Post by: Fright on September 13, 2022, 03:02:42 pm
Hi!
for example, you can add server listening on 127.0.0.1 (say 127.0.0.1:88 with "name" 127.0.0.1)
then add a location with a "/nginx_status" url pattern and link it to "127.0.0.1" Server
Hit Apply to reload templates.
go to /usr/local/etc/nginx dir and read nginx.conf file:
in the "location  /nginx_status" block you will see something like:

Code: [Select]
location  /nginx_status {
    BasicRule wl:19;
    DeniedUrl "/waf_denied.html";
    autoindex off;
    http2_push_preload off;
    include 03052a05-896e-4c6c-a6f6-680d6ae590fa_post/*.conf;
}

create "03052a05-896e-4c6c-a6f6-680d6ae590fa_post" dir inside /usr/local/etc/nginx/ dir and add status.conf file to this dir with one line:
Code: [Select]
        stub_status on;
Hit Apply button on Services: Nginx: Configuration to re-apply config and try
Quote
curl http://127.0.0.1:88/nginx_status


Title: Re: NGINX Stub_Status?
Post by: fabian on September 16, 2022, 11:18:19 pm
The plugin uses VTS for a more detailed status page. It is already available via a Unix socket.
Title: Re: NGINX Stub_Status?
Post by: itngo on November 17, 2022, 08:37:04 am
@fabian @Fright

Thank you very much! This helped a lot.