Skip to content

Commit 0824701

Browse files
committed
Fix web server detection in forcessl
1 parent 511dfa3 commit 0824701

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

bin/v-add-web-domain-ssl-force

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ if [ "$SSL" != 'yes' ]; then
4343
fi
4444

4545
# Check if proxy is active
46-
if [ ! -z "$PROXY_SYSTEM" ] || [ ! -z "$PROXY" ]; then
46+
if [ ! -z "$PROXY_SYSTEM" ]; then
4747
if ! grep --quiet "forcessl" $HESTIA/data/templates/web/nginx/default.tpl; then
4848
$BIN/v-update-web-templates
4949
fi
@@ -56,7 +56,7 @@ else
5656
fi
5757

5858
# Insert redirect commands
59-
if [ ! -z $PROXY ]; then
59+
if [ ! -z "$PROXY_SYSTEM" ] || [ "$WEB_SYSTEM" = 'nginx' ]; then
6060
echo 'return 301 https://$host$request_uri;' > $forcessl
6161
else
6262
echo 'RewriteEngine On' > $forcessl

bin/v-delete-web-domain-ssl-force

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,12 @@ is_object_valid 'web' 'DOMAIN' "$domain" "$FORCESSL"
3838
eval $(grep "DOMAIN='$domain'" $USER_DATA/web.conf)
3939

4040
# Remove forcessl configs
41-
rm -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.forcessl.conf
42-
rm -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.forcessl.conf
41+
if [ -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.forcessl.conf ]; then
42+
rm -f $HOMEDIR/$user/conf/web/$domain/$WEB_SYSTEM.forcessl.conf
43+
fi
44+
if [ -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.forcessl.conf ]; then
45+
rm -f $HOMEDIR/$user/conf/web/$domain/$PROXY_SYSTEM.forcessl.conf
46+
fi
4347

4448
#----------------------------------------------------------#
4549
# Hestia #

0 commit comments

Comments
 (0)