mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
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:
@@ -60,9 +60,8 @@ EOF
|
||||
fi
|
||||
|
||||
cat $VHOST_PATH | xargs -i echo "-----> Configuring {}..."
|
||||
NOSSL_SERVER_NAME=`echo $NONSSL_VHOSTS | tr '\n' ' '`
|
||||
# if NOSSL_SERVER_NAME is just ' ' then set NOSSL_SERVER_NAME to SSL_HOSTNAME since we redirect anyway
|
||||
[[ "$NOSSL_SERVER_NAME" = ' ' ]] && NOSSL_SERVER_NAME=$(echo $SSL_VHOSTS | tr '\n' ' ')
|
||||
# Include SSL_VHOSTS so we can redirect http to https on that hostname as well
|
||||
NOSSL_SERVER_NAME=`echo $NONSSL_VHOSTS $SSL_VHOSTS| tr '\n' ' '`
|
||||
|
||||
echo "-----> Creating $SCHEME 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;
|
||||
server_name $NOSSL_SERVER_NAME;
|
||||
return 301 https://\$host\$request_uri;
|
||||
return 301 https://$SSL_SERVER_NAME\$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
|
||||
Reference in New Issue
Block a user