Skip to content

Commit

Permalink
Improve multi-tenant api-gateway example
Browse files Browse the repository at this point in the history
  • Loading branch information
manisandro committed Jun 21, 2023
1 parent e3dbb6f commit 71726f9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/topics/MultiTenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ server {
proxy_redirect off;
server_tokens off;

location ~ ^/(?<t>tenant1|tenant2)/ {
location ~ ^/(?<t>tenant1|tenant2) {
# Extract tenant
proxy_set_header Tenant $t;
# Set headers for original request host
Expand Down Expand Up @@ -65,8 +65,13 @@ server {
proxy_pass http://qwc-admin-gui:9090;
}

# Place this one last to give precedence to the other rules
location ~ ^/[^/]+ {
# Place these last to give precedence to the other rules:

# Redirect request without trailing slash
location ~ ^(/[^/]+)$ {
return 301 $scheme://$http_host$1/;
}
location ~ ^/[^/]+/ {
rewrite ^/[^/]+(.+) $1 break;
proxy_pass http://qwc-map-viewer:9090;
}
Expand Down

0 comments on commit 71726f9

Please sign in to comment.