|
@ -56,7 +56,9 @@ apache_vhost_create() { |
|
|
protocols=$(__vhost_cfg_normalize_protocol "$cfg") || return 1 |
|
|
protocols=$(__vhost_cfg_normalize_protocol "$cfg") || return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
domain=$(get_domain "$cfg") && relation-set domain "$domain" |
|
|
|
|
|
|
|
|
domain=$(get_domain "$cfg") && { |
|
|
|
|
|
[ "$RELATION_DATA_FILE" ] && relation-set domain "$domain" |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if is_protocol_enabled https "$protocols"; then |
|
|
if is_protocol_enabled https "$protocols"; then |
|
|
if [ -z "$domain" ]; then |
|
|
if [ -z "$domain" ]; then |
|
@ -80,7 +82,8 @@ apache_vhost_create() { |
|
|
RewriteCond %{HTTPS} off |
|
|
RewriteCond %{HTTPS} off |
|
|
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L,QSA] |
|
|
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L,QSA] |
|
|
" |
|
|
" |
|
|
relation-set apache-custom-rules "$redirect_rule |
|
|
|
|
|
|
|
|
[ "$RELATION_DATA_FILE" ] && \ |
|
|
|
|
|
relation-set apache-custom-rules "$redirect_rule |
|
|
$(if [ "$custom_rules" ]; then |
|
|
$(if [ "$custom_rules" ]; then |
|
|
echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")" |
|
|
echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")" |
|
|
fi)" |
|
|
fi)" |
|
@ -89,14 +92,17 @@ $(if [ "$custom_rules" ]; then |
|
|
echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")" |
|
|
echo "- |"$'\n'"$(echo "$custom_rules" | prefix " ")" |
|
|
fi)")") |
|
|
fi)")") |
|
|
fi |
|
|
fi |
|
|
relation-set protocol https |
|
|
|
|
|
|
|
|
[ "$RELATION_DATA_FILE" ] && \ |
|
|
|
|
|
relation-set protocol https |
|
|
else |
|
|
else |
|
|
## Both services are available and different, don't do anything then ? |
|
|
## Both services are available and different, don't do anything then ? |
|
|
#relation-set protocol https |
|
|
|
|
|
|
|
|
#[ "$RELATION_DATA_FILE" ] && \ |
|
|
|
|
|
# relation-set protocol https |
|
|
: |
|
|
: |
|
|
fi |
|
|
fi |
|
|
else |
|
|
else |
|
|
relation-set protocol http |
|
|
|
|
|
|
|
|
[ "$RELATION_DATA_FILE" ] && \ |
|
|
|
|
|
relation-set protocol http |
|
|
fi |
|
|
fi |
|
|
vhost_statement=$(apache_vhost_statement "$type" "$protocols" "$cfg" "$domain") || { |
|
|
vhost_statement=$(apache_vhost_statement "$type" "$protocols" "$cfg" "$domain") || { |
|
|
err "Failed to get vhost statement for type $type on ${protocols:1:-1}" |
|
|
err "Failed to get vhost statement for type $type on ${protocols:1:-1}" |
|
|