include SSL_VHOSTS in NOSSL_SERVER_NAME so we can redirect from http to https on the secure hostname as well
This commit is contained in:
1 parent
1b208778f3
commit
59f047bb45
2 files changed
+3
-4
No files matched your search
@@ -60,9 +60,8 @@ EOF
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cat $VHOST_PATH | xargs -i echo "-----> Configuring {}..."
|
cat $VHOST_PATH | xargs -i echo "-----> Configuring {}..."
|
||||||
NOSSL_SERVER_NAME=`echo $NONSSL_VHOSTS | tr '\n' ' '`
|
# Include SSL_VHOSTS so we can redirect http to https on that hostname as well
|
||||||
# if NOSSL_SERVER_NAME is just ' ' then set NOSSL_SERVER_NAME to SSL_HOSTNAME since we redirect anyway
|
NOSSL_SERVER_NAME=`echo $NONSSL_VHOSTS $SSL_VHOSTS| tr '\n' ' '`
|
||||||
[[ "$NOSSL_SERVER_NAME" = ' ' ]] && NOSSL_SERVER_NAME=$(echo $SSL_VHOSTS | tr '\n' ' ')
|
|
||||||
|
|
||||||
echo "-----> Creating $SCHEME nginx.conf"
|
echo "-----> Creating $SCHEME nginx.conf"
|
||||||
echo "upstream $APP { server 127.0.0.1:$PORT; }" > $DOKKU_ROOT/$APP/nginx.conf
|
echo "upstream $APP { server 127.0.0.1:$PORT; }" > $DOKKU_ROOT/$APP/nginx.conf
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ server {
|
|||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name $NOSSL_SERVER_NAME;
|
server_name $NOSSL_SERVER_NAME;
|
||||||
return 301 https://\$host\$request_uri;
|
return 301 https://$SSL_SERVER_NAME\$request_uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
|||||||
Reference in new issue
Block a user