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:
1 parent
4955f9c600
commit
9111902542
1 file changed
+10
-14
+10
-14
@@ -19,22 +19,18 @@ case "$1" in
|
|||||||
|
|
||||||
if [[ ! -f $VHOST_PATH ]]; then
|
if [[ ! -f $VHOST_PATH ]]; then
|
||||||
echo "-----> Creating new $VHOST_PATH..."
|
echo "-----> Creating new $VHOST_PATH..."
|
||||||
if [[ -f "$DOKKU_ROOT/$APP/URL" ]]; then
|
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
||||||
cat "$DOKKU_ROOT/$APP/URL" > $VHOST_PATH
|
SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||||
else
|
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
||||||
VHOST=$(< "$DOKKU_ROOT/VHOST")
|
if [[ ! -n $hostname ]]; then
|
||||||
SUBDOMAIN=${APP/%\.${VHOST}/}
|
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||||
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
|
hostname="${APP/\//-}"
|
||||||
if [[ ! -n $hostname ]]; then
|
else
|
||||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
hostname="${APP/\//-}.$VHOST"
|
||||||
hostname="${APP/\//-}"
|
|
||||||
else
|
|
||||||
hostname="${APP/\//-}.$VHOST"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo $hostname > $VHOST_PATH
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo $hostname > $VHOST_PATH
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user