Skip to content

Commit 1b63456

Browse files
author
Kristan Kenney
committed
Update nginx configuration files during upgrade
1 parent e18ca0a commit 1b63456

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

install/upgrade/versions/1.3.1.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,22 @@
55
#######################################################################################
66
####### Place additional commands below. #######
77
#######################################################################################
8+
9+
# Update nginx configuration to block connections for unsigned (no SSL certificate) domains
10+
for ipaddr in $(ls /usr/local/hestia/data/ips/ 2>/dev/null); do
11+
web_conf="/etc/$WEB_SYSTEM/conf.d/$ipaddr.conf"
12+
13+
if [ "$WEB_SYSTEM" = "nginx" ]; then
14+
cp -f $HESTIA_INSTALL_DIR/nginx/unassigned.inc $web_conf
15+
sed -i 's/directIP/'$ipaddr'/g' $web_conf
16+
fi
17+
18+
if [ "$PROXY_SYSTEM" = "nginx" ]; then
19+
echo "[ * ] Adding unassigned hosts configuration to Nginx..."
20+
cat $WEBTPL/$PROXY_SYSTEM/proxy_ip.tpl |\
21+
sed -e "s/%ip%/$ipaddr/g" \
22+
-e "s/%web_port%/$WEB_PORT/g" \
23+
-e "s/%proxy_port%/$PROXY_PORT/g" \
24+
> /etc/$PROXY_SYSTEM/conf.d/$ipaddr.conf
25+
fi
26+
done

0 commit comments

Comments
 (0)