From 36423fb2bc31561f2519aedcc6193038c1b7890f Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Mon, 26 Sep 2022 16:03:12 -0400 Subject: [PATCH] auto-restart nginx if master process is killed nginx handles restarting workers automatically but the master process is typically killed by the OOM killer too. --- systemd/system/nginx.service.d/local.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systemd/system/nginx.service.d/local.conf b/systemd/system/nginx.service.d/local.conf index 0c662c1..c6b4dd2 100644 --- a/systemd/system/nginx.service.d/local.conf +++ b/systemd/system/nginx.service.d/local.conf @@ -17,6 +17,8 @@ ProtectProc=invisible ProtectSystem=strict ReadWritePaths=/var/lib/nginx /var/log/nginx -/var/cache/nginx RemoveIPC=true +Restart=always +RestartSec=1 RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX RestrictNamespaces=true RestrictRealtime=true