From 6e7ca94d84a1b2db67847c8c718134f97a92ea16 Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Thu, 17 Sep 2015 22:46:58 -0700 Subject: [PATCH] set SSL_VHOSTS to HOSTNAME if NO_VHOST is set and filter out server_name stanza if we have no hosts" --- plugins/nginx-vhosts/functions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/nginx-vhosts/functions b/plugins/nginx-vhosts/functions index 69b763cec..8b8979885 100755 --- a/plugins/nginx-vhosts/functions +++ b/plugins/nginx-vhosts/functions @@ -123,7 +123,7 @@ EOF if [[ -z "$NO_VHOST" ]]; then SSL_VHOSTS=$(egrep "^${SSL_HOSTNAME_REGEX}$" $VHOST_PATH || true) else - SSL_VHOSTS="fakedomain.com" + SSL_VHOSTS=$(< $DOKKU_ROOT/HOSTNAME) fi NONSSL_VHOSTS=$(egrep -v "^${SSL_HOSTNAME_REGEX}$" $VHOST_PATH 2> /dev/null || true) @@ -159,7 +159,7 @@ EOF xargs -i echo "-----> Configuring {}..." <<< "$NONSSL_VHOSTS" fi eval "cat <<< \"$(< $NGINX_TEMPLATE)\" >> $NGINX_CONF" - if [[ -n "$NO_VHOST" ]] || [[ -z "$NONSSL_VHOSTS" ]];then + if [[ -n "$NO_VHOST" ]] || ([[ -z "$NONSSL_VHOSTS" ]] && [[ -z "$SSL_VHOSTS" ]]); then sed --in-place -n -e '/^.*server_name.*$/!p' $NGINX_CONF fi