feat: do not append the global domain for matching subdomains
If the subdomain is url-like, assume it is a valid url and use it for the default domain name. This allows users to specify the default domain for an app even if that is a subdomain of a global vhost. Closes #3529
This commit is contained in:
@@ -249,7 +249,7 @@ get_default_vhosts() {
|
||||
local SUBDOMAIN=${APP/%\.${VHOST}/}
|
||||
local hostname=$(: | plugn trigger nginx-hostname "$APP" "$SUBDOMAIN" "$VHOST")
|
||||
if [[ -z $hostname ]]; then
|
||||
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
|
||||
if [[ "$APP" == *.* ]]; then
|
||||
local hostname="${APP/\//-}"
|
||||
else
|
||||
local hostname="${APP/\//-}.$VHOST"
|
||||
|
||||
@@ -44,13 +44,13 @@ cmd-domains-report-single() {
|
||||
verify_app_name "$APP"
|
||||
app_flags=(
|
||||
"--domains-app-enabled: $(fn-domains-app-enabled "$APP")"
|
||||
"--domains-app-vhosts: $(fn-domains-app-vhosts "$APP")"
|
||||
"--domains-app-vhosts: $(fn-domains-app-vhosts "$APP" | awk '{$1=$1};1')"
|
||||
)
|
||||
fi
|
||||
|
||||
global_flags=(
|
||||
"--domains-global-enabled: $(fn-domains-global-enabled)"
|
||||
"--domains-global-vhosts: $(fn-domains-global-vhosts)"
|
||||
"--domains-global-vhosts: $(fn-domains-global-vhosts | awk '{$1=$1};1')"
|
||||
)
|
||||
|
||||
flag_map=("${app_flags[@]}" "${global_flags[@]}")
|
||||
|
||||
Reference in New Issue
Block a user