Allow symlinks for SSL cert detection in nginx-vhosts post-deploy

This commit is contained in:
Stafford Brunk
2014-04-03 07:15:21 -06:00
parent bd5b2b210c
commit dfac47cbe2

View File

@@ -13,14 +13,14 @@ if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
hostname="${APP/\//-}.$VHOST"
fi
if [[ -f "$SSL/server.crt" ]] && [[ -f "$SSL/server.key" ]]; then
if [[ -e "$SSL/server.crt" ]] && [[ -e "$SSL/server.key" ]]; then
SSL_INUSE="$SSL"
SSL_DIRECTIVES=$(cat <<EOF
ssl_certificate $SSL_INUSE/server.crt;
ssl_certificate_key $SSL_INUSE/server.key;
EOF
)
elif [[ -f "$WILDCARD_SSL/server.crt" ]] && [[ -f "$WILDCARD_SSL/server.key" ]] && [[ $hostname = `openssl x509 -in $WILDCARD_SSL/server.crt -noout -subject | tr '/' '\n' | grep CN= | cut -c4-` ]]; then
elif [[ -e "$WILDCARD_SSL/server.crt" ]] && [[ -e "$WILDCARD_SSL/server.key" ]] && [[ $hostname = `openssl x509 -in $WILDCARD_SSL/server.crt -noout -subject | tr '/' '\n' | grep CN= | cut -c4-` ]]; then
SSL_INUSE="$WILDCARD_SSL"
SSL_DIRECTIVES=""
fi