mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-15 10:58:22 +00:00
fix: remove stale nginx pid file before starting nginx
When /run/nginx is already owned by PUID:PGID, the ownership step skips it, so a leftover nginx.pid owned by root stays in place and nginx, running as PUID:PGID, fails with "Permission denied" on every start. Nginx is not running yet during prepare, so remove the pid file there. Fixes #5964 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1aca775cb9
commit
c23a1cb343
1 file changed
+4
@@ -39,3 +39,7 @@ touch /var/log/nginx/error.log || true
|
||||
chmod 777 /var/log/nginx/error.log || true
|
||||
chmod -R 777 /var/cache/nginx || true
|
||||
chmod 644 /etc/logrotate.d/nginx-proxy-manager
|
||||
|
||||
# nginx has not been started yet, so any pid file here is stale. Remove it,
|
||||
# otherwise a pid file owned by another user stops nginx starting as PUID:PGID
|
||||
rm -f /run/nginx/nginx.pid
|
||||
Reference in new issue
Block a user