Skip to content

Commit f662886

Browse files
authored
Merge pull request hestiacp#1878 from myrevery/fix/nginx-conf
Fix potential issue of updating to Nginx 1.21.0
2 parents 20b0fd9 + 6d398f6 commit f662886

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

install/upgrade/versions/1.4.2.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,16 @@ if [ "$FIREWALL_SYSTEM" = "iptables" ]; then
1414
rm -f /usr/lib/networkd-dispatcher/routable.d/50-ifup-hooks /etc/network/if-pre-up.d/iptables
1515
$BIN/v-update-firewall
1616
fi
17+
18+
# Fix potential issue of updating to Nginx 1.21.0
19+
if [ "WEB_SYSTEM" = "nginx" ] || [ "PROXY_SYSTEM" = "nginx" ]; then
20+
default_conf="/etc/nginx/conf.d/default.conf"
21+
nginx_conf="/etc/nginx/nginx.conf"
22+
23+
[ -f "${default_conf}" ] && mv -f ${default_conf} ${default_conf}.dpkg-dist
24+
[ -f "${default_conf}.dpkg-new" ] && mv -f ${default_conf}.dpkg-new ${default_conf}.dpkg-dist
25+
[ -f "${nginx_conf}.dpkg-new" ] && mv -f ${nginx_conf}.dpkg-new ${nginx_conf}.dpkg-dist
26+
[ -f "${nginx_conf}.dpkg-old" ] && mv -f ${nginx_conf} ${nginx_conf}.dpkg-dist \
27+
&& rm -f ${nginx_conf}.dpkg-old \
28+
&& cp -f $HESTIA/install/deb/nginx/nginx.conf /etc/nginx/
29+
fi

0 commit comments

Comments
 (0)