It appears that the problem comes from these redirects in regiond.nginx.conf:
```
location = / { return 301 /MAAS/r/; }
location ~ ^/MAAS/?$ { return 301 /MAAS/r/; } ```
A potential fix could be to turn off absolute redirects, so that redirects will be automatically interpreted in the context of the requesting url:
``` diff --git a/src/maasserver/templates/http/regiond.nginx.conf.template b/src/maasserver/templates/http/regiond.nginx.conf.template index b45a7fff9..d9593ccc9 100644 --- a/src/maasserver/templates/http/regiond.nginx.conf.template +++ b/src/maasserver/templates/http/regiond.nginx.conf.template @@ -30,6 +30,9 @@ server { listen {{http_port}}; {{endif}}
+ absolute_redirect off; + port_in_redirect off; + location = / { return 301 /MAAS/r/; } ```
It appears that the problem comes from these redirects in regiond.nginx.conf:
```
location = / {
return 301 /MAAS/r/;
}
location ~ ^/MAAS/?$ {
return 301 /MAAS/r/;
}
```
A potential fix could be to turn off absolute redirects, so that redirects will be automatically interpreted in the context of the requesting url:
``` r/templates/ http/regiond. nginx.conf. template b/src/maasserve r/templates/ http/regiond. nginx.conf. template .d9593ccc9 100644 r/templates/ http/regiond. nginx.conf. template r/templates/ http/regiond. nginx.conf. template
diff --git a/src/maasserve
index b45a7fff9.
--- a/src/maasserve
+++ b/src/maasserve
@@ -30,6 +30,9 @@ server {
listen {{http_port}};
{{endif}}
+ absolute_redirect off;
+ port_in_redirect off;
+
location = / {
return 301 /MAAS/r/;
}
```