0

Sometimes nginx randomly crashes (once every few months) Here's the log I got when I ran systemctl status nginx

    nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:>
     Active: failed (Result: core-dump) since Tue 2023-01-24 11:09:29 UTC; 3h 4>
       Docs: man:nginx(8)
   Main PID: 265516 (code=dumped, signal=SEGV)
      Tasks: 0 (limit: 2351)
     Memory: 15.9M
     CGroup: /system.slice/nginx.service

Nov 25 08:52:52 ip-172-31-16-145 systemd[1]: Starting A high performance web se>
Nov 25 08:52:52 ip-172-31-16-145 systemd[1]: Started A high performance web ser>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Main process exited>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Killing process 631>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Killing process 631>
Jan 24 11:09:29 ip-172-31-16-145 systemd[1]: nginx.service: Failed with result >

I'm looking for a way to fix this or at least to restart nginx automatically when it happen.

The server is an EC2 Ubuntu instance on AWS.

1 Answers1

0

Older nginx versions contain some issues that cause core dumps.

Check nginx changelog to see if your setup is related and update nginx to a recent version. That will likely fix the crashes.

Tero Kilkanen
  • 36,796
  • 3
  • 41
  • 63
  • Updated to 1.22 (for some reason apt had 1.18 as the latest version but found a way to install a later one). I hope this will work. – Nicolas B. Jan 25 '23 at 20:48