From 07abb105d06fb49ef0690e0acbf837b818e959f1 Mon Sep 17 00:00:00 2001 From: "CanbiZ (MickLesk)" <47820557+MickLesk@users.noreply.github.com> Date: Mon, 11 May 2026 22:04:04 +0200 Subject: [PATCH] Nginxproxymanager: restore NPM nginx.conf after OpenResty rebuid (#14421) When OpenResty is rebuilt via 'make install', it overwrites /usr/local/openresty/nginx/conf/nginx.conf with the stock OpenResty default config, dropping all NPM-specific include directives. This causes port 81 to stop listening and conf.d configs to be ignored. After the build, restore the NPM nginx.conf from the deployed source, re-apply daemon/include-path patches, then apply user/pid fixes. --- ct/nginxproxymanager.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ct/nginxproxymanager.sh b/ct/nginxproxymanager.sh index 3a63fdfa0..a13c888c3 100644 --- a/ct/nginxproxymanager.sh +++ b/ct/nginxproxymanager.sh @@ -92,6 +92,11 @@ ExecStart=/usr/local/openresty/nginx/sbin/nginx -g 'daemon off;' [Install] WantedBy=multi-user.target EOF + if [ -f /opt/nginxproxymanager/docker/rootfs/etc/nginx/nginx.conf ]; then + cp /opt/nginxproxymanager/docker/rootfs/etc/nginx/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf + sed -i 's+^daemon+#daemon+g' /usr/local/openresty/nginx/conf/nginx.conf + sed -i 's+include conf.d+include /etc/nginx/conf.d+g' /usr/local/openresty/nginx/conf/nginx.conf + fi sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf systemctl daemon-reload systemctl unmask openresty 2>/dev/null || true