In my nginx config i have a location block for a subpath:
location /documentation {
alias /usr/share/nginx/html/documentation;
index index.html;
try_files $uri $uri/ /documentation/index.html;
}
And technicaly, it works. However only when i navigate to http://localhost:90/documentation/. When i navigate to http://localhost:90/documentation, it redirects me to http://localhost/documentation/ which fails of course because i have lost my port.
Here is the log of the redirect: 172.24.0.1 - - [26/Feb/2024:09:12:56 +0000] "GET /documentation HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36" "-"
If anyone has a clue as to why this redirect happens?
This may be important: At this location, i'm serving a static build of a Docusaurus. and the whole setup is in a docker container.