OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • English Forums »
  • 22.7 Legacy Series »
  • NGINX Stub_Status?
« previous next »
  • Print
Pages: [1]

Author Topic: NGINX Stub_Status?  (Read 654 times)

itngo

  • Newbie
  • *
  • Posts: 42
  • Karma: 0
    • View Profile
NGINX Stub_Status?
« 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?
Logged

Fright

  • Hero Member
  • *****
  • Posts: 1468
  • Karma: 130
    • View Profile
Re: NGINX Stub_Status?
« Reply #1 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
Logged

itngo

  • Newbie
  • *
  • Posts: 42
  • Karma: 0
    • View Profile
Re: NGINX Stub_Status?
« Reply #2 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?
Logged

Fright

  • Hero Member
  • *****
  • Posts: 1468
  • Karma: 130
    • View Profile
Re: NGINX Stub_Status?
« Reply #3 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


Logged

fabian

  • Hero Member
  • *****
  • Posts: 2768
  • Karma: 199
  • OPNsense Contributor (Language, VPN, Proxy, etc.)
    • View Profile
    • Personal Homepage
Re: NGINX Stub_Status?
« Reply #4 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.
Logged

itngo

  • Newbie
  • *
  • Posts: 42
  • Karma: 0
    • View Profile
Re: NGINX Stub_Status?
« Reply #5 on: November 17, 2022, 08:37:04 am »
@fabian @Fright

Thank you very much! This helped a lot.
Logged

  • Print
Pages: [1]
« previous next »
  • OPNsense Forum »
  • English Forums »
  • 22.7 Legacy Series »
  • NGINX Stub_Status?
 

OPNsense is an OSS project © Deciso B.V. 2015 - 2023 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2