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.