fix(termix): resolve nginx reload error due to duplicate master_process directive (#11241)

- Remove Docker-specific 'master_process' and 'pid' directives from nginx.conf
- These directives conflict when used with systemd nginx in LXC environment
- Keep complete upstream nginx.conf configuration otherwise intact
- Add PORT variable replacement to use port 80
- Add nginx -t validation before reload
This commit is contained in:
MickLesk
2026-01-27 21:22:40 +01:00
parent 26c68bad4d
commit e7e45db45b
2 changed files with 18 additions and 11 deletions

View File

@@ -61,12 +61,15 @@ cp -r /opt/termix/public/fonts /opt/termix/html/fonts 2>/dev/null || true
msg_ok "Set up Directories"
msg_info "Configuring Nginx"
curl -fsSL "https://raw.githubusercontent.com/Termix-SSH/Termix/main/docker/nginx.conf" -o /etc/nginx/sites-available/termix.conf
sed -i 's|/app/html|/opt/termix/html|g' /etc/nginx/sites-available/termix.conf
sed -i 's|/app/nginx|/opt/termix/nginx|g' /etc/nginx/sites-available/termix.conf
curl -fsSL "https://raw.githubusercontent.com/Termix-SSH/Termix/main/docker/nginx.conf" -o /etc/nginx/nginx.conf
sed -i '/^master_process/d' /etc/nginx/nginx.conf
sed -i '/^pid \/app\/nginx/d' /etc/nginx/nginx.conf
sed -i 's|/app/html|/opt/termix/html|g' /etc/nginx/nginx.conf
sed -i 's|/app/nginx|/opt/termix/nginx|g' /etc/nginx/nginx.conf
sed -i 's|listen ${PORT};|listen 80;|g' /etc/nginx/nginx.conf
rm -f /etc/nginx/sites-enabled/default
rm -f /etc/nginx/nginx.conf
ln -sf /etc/nginx/sites-available/termix.conf /etc/nginx/nginx.conf
nginx -t
systemctl reload nginx
msg_ok "Configured Nginx"