Fix issue where VHOST was not properly being set
The URL file is being rewritten on every deploy by `dokku deploy` and thus that file was incorrect. Instead, we just reuse the old logic from the nginx-vhosts plugin to handle creation of the VHOST file
This commit is contained in:
@@ -19,22 +19,18 @@ case "$1" in
|
||||
|
||||
if [[ ! -f $VHOST_PATH ]]; then
|
||||
echo "-----> Creating new $VHOST_PATH..."
|
||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
||||
cat "$DOKKU_ROOT/$APP/URL" > $VHOST_PATH
|
||||
else
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||
if [[ ! -n $hostname ]]; then
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
hostname="${APP/\//-}"
|
||||
else
|
||||
hostname="${APP/\//-}.$VHOST"
|
||||
fi
|
||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||
if [[ ! -n $hostname ]]; then
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
hostname="${APP/\//-}"
|
||||
else
|
||||
hostname="${APP/\//-}.$VHOST"
|
||||
fi
|
||||
|
||||
echo $hostname > $VHOST_PATH
|
||||
fi
|
||||
|
||||
echo $hostname > $VHOST_PATH
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user