mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-03 20:03:25 +01:00
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:
16
ct/termix.sh
16
ct/termix.sh
@@ -82,17 +82,21 @@ function update_script() {
|
|||||||
msg_ok "Updated Frontend Files"
|
msg_ok "Updated Frontend Files"
|
||||||
|
|
||||||
msg_warn "The Nginx configuration may need to be updated for new features to work."
|
msg_warn "The Nginx configuration may need to be updated for new features to work."
|
||||||
msg_custom "💾" "Your current config will be backed up to termix.conf.bak"
|
msg_custom "💾" "Your current config will be backed up to nginx.conf.bak"
|
||||||
msg_custom "⚠️ " "Note: Custom modifications (reverse proxy, SSL) will be overwritten!"
|
msg_custom "⚠️ " "Note: Custom modifications (reverse proxy, SSL) will be overwritten!"
|
||||||
echo ""
|
echo ""
|
||||||
read -rp "${TAB3}Update Nginx configuration? [Y/n]: " REPLY
|
read -rp "${TAB3}Update Nginx configuration? [Y/n]: " REPLY
|
||||||
if [[ "${REPLY,,}" =~ ^(y|yes|)$ ]]; then
|
if [[ "${REPLY,,}" =~ ^(y|yes|)$ ]]; then
|
||||||
msg_info "Updating Nginx Configuration"
|
msg_info "Updating Nginx Configuration"
|
||||||
cp /etc/nginx/sites-available/termix.conf /etc/nginx/sites-available/termix.conf.bak
|
cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
|
||||||
curl -fsSL "https://raw.githubusercontent.com/Termix-SSH/Termix/main/docker/nginx.conf" -o /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 's|/app/html|/opt/termix/html|g' /etc/nginx/sites-available/termix.conf
|
sed -i '/^master_process/d' /etc/nginx/nginx.conf
|
||||||
sed -i 's|/app/nginx|/opt/termix/nginx|g' /etc/nginx/sites-available/termix.conf
|
sed -i '/^pid \/app\/nginx/d' /etc/nginx/nginx.conf
|
||||||
systemctl reload nginx
|
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
|
||||||
|
|
||||||
|
nginx -t && systemctl reload nginx
|
||||||
msg_ok "Updated Nginx Configuration"
|
msg_ok "Updated Nginx Configuration"
|
||||||
else
|
else
|
||||||
msg_warn "Nginx configuration not updated. If Termix doesn't work, restore from backup or update manually."
|
msg_warn "Nginx configuration not updated. If Termix doesn't work, restore from backup or update manually."
|
||||||
|
|||||||
@@ -61,12 +61,15 @@ cp -r /opt/termix/public/fonts /opt/termix/html/fonts 2>/dev/null || true
|
|||||||
msg_ok "Set up Directories"
|
msg_ok "Set up Directories"
|
||||||
|
|
||||||
msg_info "Configuring Nginx"
|
msg_info "Configuring Nginx"
|
||||||
curl -fsSL "https://raw.githubusercontent.com/Termix-SSH/Termix/main/docker/nginx.conf" -o /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 's|/app/html|/opt/termix/html|g' /etc/nginx/sites-available/termix.conf
|
sed -i '/^master_process/d' /etc/nginx/nginx.conf
|
||||||
sed -i 's|/app/nginx|/opt/termix/nginx|g' /etc/nginx/sites-available/termix.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/sites-enabled/default
|
||||||
rm -f /etc/nginx/nginx.conf
|
nginx -t
|
||||||
ln -sf /etc/nginx/sites-available/termix.conf /etc/nginx/nginx.conf
|
|
||||||
systemctl reload nginx
|
systemctl reload nginx
|
||||||
msg_ok "Configured Nginx"
|
msg_ok "Configured Nginx"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user