diff --git a/scripts/network/traefik/traefik_port_subdomains.sh b/scripts/network/traefik/traefik_port_subdomains.sh index dd498eb..52fa315 100644 --- a/scripts/network/traefik/traefik_port_subdomains.sh +++ b/scripts/network/traefik/traefik_port_subdomains.sh @@ -38,10 +38,12 @@ tagsProcessorPortSubdomains() if [[ "$p_traefik" == "true" ]]; then local host - if [[ -z "$p_sub" || "$p_sub" == "@" || "$p_sub" == "root" ]]; then - host="${domain_full}" # apex / root of the domain - else + if [[ "$p_sub" == "@" || "$p_sub" == "root" ]]; then + host="${domain_full}" # apex / root of the domain (explicit only) + elif [[ -n "$p_sub" ]]; then host="${p_sub}.${domain_full}" # subdomain (single or multi-level) + else + host="${app_name}.${domain_full}" # no subdomain set -> app-name default fi tagsManagerUpdateUniversalTag "$file" "DOMAINSUBNAME_TAG_${idx}" "$host" fi