ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    NGINX Just Stop Working

    IT Discussion
    nginx ubuntu 20.04
    7
    37
    2.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • NashBrydgesN
      NashBrydges
      last edited by

      I have NGINX running on an Ubuntu 20.04 instance. It runs nothing but NGINX and is hosted on hyper-v server. Everything is running with all updates applied.

      The issue is that NGINX will randomly just stop routing requests. Websites and services are going offline and looking at the NGINX logs (/var/log/nginx) as well as the syslog doesn't show any errors but when I check to see if the NGINX service is running, it shows as stopped. All I have to do is reboot the Ubuntu server and everything works again (restarting NGINX service doesn't always fix the issue but a server reboot works every time). No other change required, just a reboot.

      It's proxying for only a dozen sites and services and traffic is not that high. Looking at resource utilization doesn't indicate there are problems there.

      I'm already running auto reboots every night but these random stops continue to happen (before someone asks, no, the issues are not correlated with the reboot schedule). Before I enable debug logging, I thought I'd reach out here to see if anyone else had experienced this before and how you might have fixed it. Should I be looking elsewhere for details on what might be causing this?

      travisdh1T scottalanmillerS 3 Replies Last reply Reply Quote 1
      • scottalanmillerS
        scottalanmiller
        last edited by

        What do the logs say leading up to it stopping?

        1 Reply Last reply Reply Quote 0
        • ObsolesceO
          Obsolesce
          last edited by

          What does error.log say?

          Are you running certbot?

          1 Reply Last reply Reply Quote 0
          • NashBrydgesN
            NashBrydges
            last edited by

            Sorry, running out the door for a client. I'll grab the logs and post the contents this weekend.

            I am running certbot for Let's Encrypt.

            ObsolesceO 1 Reply Last reply Reply Quote 0
            • travisdh1T
              travisdh1 @NashBrydges
              last edited by

              @NashBrydges Since nginx is running, this should return ok, but you might want to try a nginx -t

              1 Reply Last reply Reply Quote 0
              • ObsolesceO
                Obsolesce @NashBrydges
                last edited by

                @NashBrydges said in NGINX Just Stop Working:

                I am running certbot

                Is it up to date?

                NashBrydgesN 1 Reply Last reply Reply Quote 0
                • NashBrydgesN
                  NashBrydges @Obsolesce
                  last edited by

                  @Obsolesce Yes, all packages are up to date.

                  1 Reply Last reply Reply Quote 0
                  • NashBrydgesN
                    NashBrydges
                    last edited by

                    Here is the only entry in the NGINX error log for the last time NGINX stopped.

                    2021/01/08 22:34:03 [error] 847#847: *195 access forbidden by rule, client: 195.154.63.222, server: plextrack.jpslconsulting.ca, request: "GET / HTTP/1.1", host: "plextrack.jpslconsulting.ca"
                    

                    The Let's Encrypt log shows no activity immediately before the outage.

                    Syslog also shows no errors. It has entries from 3AM to 3:155AM and 9:59PM to 10:02PM on the day of the last incident however the outage occurred between 7:06PM and 10:00PM so the only related entries in this log are at the time the outage was discovered and Ubuntu restarted.

                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                    • NashBrydgesN
                      NashBrydges
                      last edited by

                      I also ran the NGINX test and all looks good.

                      f47aae17-6fe2-4d6f-90da-fc87044478a7-image.png

                      scottalanmillerS 1 Reply Last reply Reply Quote 1
                      • black3dynamiteB
                        black3dynamite
                        last edited by black3dynamite

                        certbot.timer failing?
                        https://stackoverflow.com/a/52967898

                        541d67cb-6213-4968-b6b3-494934edcc3f-image.png

                        NashBrydgesN 1 Reply Last reply Reply Quote 0
                        • NashBrydgesN
                          NashBrydges @black3dynamite
                          last edited by NashBrydges

                          @black3dynamite I'm not seeing any evidence of this failing in the letsencrypt.log file syslog or nginx logs (both access and error). Would those logs be elsewhere? Obviously I don't want to have to manually renew certs.

                          black3dynamiteB 1 Reply Last reply Reply Quote 0
                          • black3dynamiteB
                            black3dynamite @NashBrydges
                            last edited by

                            @NashBrydges letsencrypt.log is the only one I'm aware of. Actually are using systemd to renew your certs or cronjob?

                            NashBrydgesN 1 Reply Last reply Reply Quote 0
                            • NashBrydgesN
                              NashBrydges @black3dynamite
                              last edited by

                              @black3dynamite systemd...

                              5447043d-d00f-4ad7-bd52-d3a4644aa9c1-image.png

                              1 Reply Last reply Reply Quote 0
                              • scottalanmillerS
                                scottalanmiller @NashBrydges
                                last edited by

                                @NashBrydges said in NGINX Just Stop Working:

                                I also ran the NGINX test and all looks good.

                                f47aae17-6fe2-4d6f-90da-fc87044478a7-image.png

                                If they weren't it wouldn't even start up.

                                1 Reply Last reply Reply Quote 0
                                • scottalanmillerS
                                  scottalanmiller @NashBrydges
                                  last edited by

                                  @NashBrydges said in NGINX Just Stop Working:

                                  Here is the only entry in the NGINX error log for the last time NGINX stopped.

                                  The error log is where it records HTTP errors, not Nginx software errors.

                                  NashBrydgesN ObsolesceO 2 Replies Last reply Reply Quote 0
                                  • NashBrydgesN
                                    NashBrydges @scottalanmiller
                                    last edited by

                                    @scottalanmiller Well at this point I'm looking at any log that has "error" in the name. Lol

                                    scottalanmillerS 1 Reply Last reply Reply Quote 0
                                    • scottalanmillerS
                                      scottalanmiller @NashBrydges
                                      last edited by

                                      @NashBrydges said in NGINX Just Stop Working:

                                      @scottalanmiller Well at this point I'm looking at any log that has "error" in the name. Lol

                                      This should show you what there is for Nginx itself....

                                      grep nginx /var/log/messages
                                      
                                      NashBrydgesN 1 Reply Last reply Reply Quote 1
                                      • NashBrydgesN
                                        NashBrydges @scottalanmiller
                                        last edited by

                                        @scottalanmiller said in NGINX Just Stop Working:

                                        grep nginx /var/log/messages

                                        /var/log/messages
                                        

                                        Does not exist.

                                        scottalanmillerS 1 Reply Last reply Reply Quote 0
                                        • scottalanmillerS
                                          scottalanmiller @NashBrydges
                                          last edited by

                                          @NashBrydges said in NGINX Just Stop Working:

                                          @scottalanmiller said in NGINX Just Stop Working:

                                          grep nginx /var/log/messages

                                          /var/log/messages
                                          

                                          Does not exist.

                                          Oh sorry, use Ubuntu's log. That's RHELs.

                                          dafyreD NashBrydgesN 2 Replies Last reply Reply Quote 0
                                          • ObsolesceO
                                            Obsolesce @scottalanmiller
                                            last edited by

                                            @scottalanmiller said in NGINX Just Stop Working:

                                            @NashBrydges said in NGINX Just Stop Working:

                                            Here is the only entry in the NGINX error log for the last time NGINX stopped.
                                            

                                            The error log is where it records HTTP errors, not Nginx software errors.

                                            Which is useful for in a case I've seen where the service was started by other means, and showed all addresses were already in use.

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post