diff --git a/src/gateway/http.conf.template b/src/gateway/http.conf.template index 3d5c7e2..53b872e 100644 --- a/src/gateway/http.conf.template +++ b/src/gateway/http.conf.template @@ -5,11 +5,15 @@ server { server_name "~^(?.+?)?\.(?.+?)?\.(?.+)\.(?.+)$" "~^(?.+)\.(?.+)\.(?.+)$" "~^(?.+)\.(?.+)$"; #access_log /var/log/nginx/host.access.log main; - set $target http://$subdomain-$domain-$tld; + set $target http://$subdomain-$domain-$tld; + + if ($app != '') { + set $target http://$app-$subdomain-$domain-$tld; + } + if ($subdomain = '') { set $target http://$domain-$tld; } - location /test { add_header Content-Type text/plain; return 200 "target: $target \napp: $app - subdomain: $subdomain - domain: $domain.$tld";