UnKwicks Posted September 11, 2020 Share Posted September 11, 2020 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 Quote Link to comment
Squid Posted September 11, 2020 Share Posted September 11, 2020 You would make the appropriate changes via a script in the /config/go file on the flash drive Quote Link to comment
UnKwicks Posted September 11, 2020 Author Share Posted September 11, 2020 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. Quote Link to comment
UnKwicks Posted September 15, 2020 Author Share Posted September 15, 2020 no idea anyone? Quote Link to comment
dnLL Posted April 3 Share Posted April 3 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? Quote Link to comment
dnLL Posted April 8 Share Posted April 8 (edited) 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 April 8 by dnLL Quote Link to comment
Recommended Posts
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.