Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

get nginx_status via stub_status

Featured Replies

Hi

for my Monitoring with zabbix I want to call the stub_status of nginx. I saw that the stub_status module is already installed but no location is set.

Therefore I have to add this location to the nginx config.

#nginx_status
location /nginx_status {
	stub_status;
	
    allow 10.0.0.111;
	deny all;
    }

Does anyone know a way how to do this safely and persists after reboot?

 

Thanks for any idea

You would make the appropriate changes via a script in the /config/go file on the flash drive

  • Author
26 minutes ago, Squid said:

You would make the appropriate changes via a script in the /config/go file on the flash drive

thanks for your reply. I am aware of the go file.

My question is more how to safely do it.

I tried manually to add the location part to the emhttp-server.conf of nginx but my customization does not even survive a nginx reload.

So I need to solve this problem first, how to add this part to the server block of the nginx conf. 

Next step would then be to keep the change to persist on unraid reboot via go file.

 

  • Author

no idea anyone?

  • 3 years later...

Old thread but also an issue for me right now. `/etc/nginx/conf.d/servers.conf` and `/etc/nginx/conf.d/locations.conf` are dynamically rewritten each time nginx is loaded (as programmed in `/etc/rc.d/rc.nginx`). Other files in `conf.d` are ignored. Editing `nginx.conf` directly on every boot could create problems later on with future updates. 

 

Not sure what's the best approach to this. Also curious why the nginx_status was disabled, as there are traces here in the forums and elsewhere in Unraid that this might have been enabled in the past. Performance issue?

On 9/15/2020 at 6:45 AM, UnKwicks said:

no idea anyone?

Got it working. Whether it's worth the hassle or not depends on what you are trying to do... monitoring the nginx status webpage from Unraid isn't particularly useful outside of academic purposes.

 

If you look at /etc/rc.d/rc.nginx, it overwrites /etc/nginx/conf.d/locations.conf and /etc/nginx/conf.d/servers.conf on every reload. locations.conf is where you want to add the status page, so you need to edit build_locations(). I suggest adding the entry after nchan_stub_status to make it look like that:

        location /nchan_stub_status {
            nchan_stub_status;
        }
        location /nginx_status {
            stub_status;
        }

Now, this might get overwritten after an update or a reboot (haven't really tested yet), so you might want to add a user script that runs on first start of your array to edit rc.nginx and reload it.

Edited by dnLL

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.