diff --git a/core/nginx/config.py b/core/nginx/config.py index 7650aa71..360ce683 100755 --- a/core/nginx/config.py +++ b/core/nginx/config.py @@ -30,4 +30,5 @@ if args["TLS"] and not all(os.path.exists(file_path) for file_path in args["TLS" # Build final configuration paths convert("/conf/tls.conf", "/etc/nginx/tls.conf", args) convert("/conf/nginx.conf", "/etc/nginx/nginx.conf", args) -os.system("nginx -s reload") +if os.path.exists("/var/log/nginx.pid"): + os.system("nginx -s reload") diff --git a/core/nginx/start.py b/core/nginx/start.py index daf05e1a..f225b5f6 100755 --- a/core/nginx/start.py +++ b/core/nginx/start.py @@ -3,6 +3,9 @@ import os import subprocess +# Check if a stale pid file exists +if os.path.exists("/var/log/nginx.pid"): + os.remove("/var/log/nginx.pid") # Actual startup script if not os.path.exists("/certs/dhparam.pem") and os.environ["TLS_FLAVOR"] != "notls":