April 19, 20242 yr Occasionally the main GUI nginx instance crashes. I'd like to know if anyone has a solution for this. Is there a script I can run to detect a crash and re-start the main GUI NGINX? Other services are always working but no access to server. I currently keep SSH turned off. Currently new server build has no soft power button on my server to initiate a restart. Although have now bought one on amazon. Edited April 19, 20242 yr by dopeytree
April 20, 20242 yr Author Ok here's a user script. #!/bin/bash NGINX_LOG="/var/log/nginx/error.log" # Monitor NGINX error log for specific error messages tail -n0 -F ${NGINX_LOG} | while read LINE; do if echo $LINE | grep -q "504 Gateway Time-out"; then echo "NGINX error detected: $LINE" echo "Restarting NGINX..." systemctl restart nginx fi done and schedules to run every minute with * * * * *
April 21, 20242 yr Community Expert I sometimes see this on older hardware and only at boot. Using your script above one could use the flash drive's go file for this. Otherwise, the above script in a cron via the user script plug doe indeed accomplish this. The go file is located at /boot/config in unraid or in the config folder when the unraid flash drive is plugged into another PC. My understanding is that unraid uses nginx for ssl https. They now use emhttp for the main web gui server. This is why the go file default starts the web server: #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & to only have this on boot: edit the go file to: #!/bin/bash # Start the Management Utility /usr/local/sbin/emhttp & #Nginx SSL - Https Check NGINX_LOG="/var/log/nginx/error.log" # Monitor NGINX error log for specific error messages tail -n0 -F ${NGINX_LOG} | while read LINE; do if echo $LINE | grep -q "504 Gateway Time-out"; then echo "NGINX error detected: $LINE" echo "Restarting NGINX..." /etc/rc.d/rc.nginx restart fi done Unraid doesn't have services nor systemctl to check a server /etc/rc.d/rc.%service_Name% ex /etc/rc.d/rc.nginx status Edited April 21, 20242 yr by bmartino1
April 22, 20242 yr Author Thanks hmm ok weird. For me a I have a 13500H and it only happens very rarely usually after a container update. Specifically this happened after updating 'netdata' while the server was doing some other intensive tasks. It would also happen occasionally on the old server. Hence looking for a solution other than shutdown / reboot the server which can cause a parity error if its locked up something else. When I do a search for '504 nginx' its quite common but no one seems to have built this kind of script into the OS yet. Edited April 22, 20242 yr by dopeytree
April 22, 20242 yr Community Expert are you runnign lattes release? 6.12.10 if runing 6.12.8 or 6.12.9 you need to install the docker patch from squid.
April 22, 20242 yr Author On latest release. Anyway why would docker lock up the GUI's nginx SSL layer? Edited April 22, 20242 yr by dopeytree
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.