File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ if [ "$SSL" != 'yes' ]; then
4343fi
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
5656fi
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
6161else
6262 echo ' RewriteEngine On' > $forcessl
6868# Hestia #
6969# ----------------------------------------------------------#
7070
71+ if [ -z " $FORCESSL " ]; then
72+ add_object_key " web" ' DOMAIN' " $domain " ' FORCESSL' ' SSL'
73+ fi
74+
7175# Set forcessl flag to enabled
7276update_object_value ' web' ' DOMAIN' " $domain " ' $FORCESSL' ' yes'
7377
Original file line number Diff line number Diff line change @@ -38,13 +38,21 @@ is_object_valid 'web' 'DOMAIN' "$domain" "$FORCESSL"
3838eval $( 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 #
4650# ----------------------------------------------------------#
4751
52+ if [ -z " $FORCESSL " ]; then
53+ add_object_key " web" ' DOMAIN' " $domain " ' FORCESSL' ' SSL'
54+ fi
55+
4856update_object_value ' web' ' DOMAIN' " $domain " ' $FORCESSL' ' no'
4957
5058# Restart services if requested
You can’t perform that action at this time.
0 commit comments