Skip to content

Commit

Permalink
Fix http routing when specifying a sub-subdomain
Browse files Browse the repository at this point in the history
  • Loading branch information
thebalaa committed May 8, 2024
1 parent a00a3b3 commit ab1b5a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/gateway/http.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ server {
server_name "~^(?<app>.+?)?\.(?<subdomain>.+?)?\.(?<domain>.+)\.(?<tld>.+)$" "~^(?<subdomain>.+)\.(?<domain>.+)\.(?<tld>.+)$" "~^(?<domain>.+)\.(?<tld>.+)$";
#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";
Expand Down

0 comments on commit ab1b5a7

Please sign in to comment.