azure front door – Nginx is dropping part of request path in the request URL when redirecting after adding a trailing slash
I have a horrible issue with Nginx. I have a service like td22-2.test.net/ I use Azure Frontdoor to forward requests from example.net/td/22-2/ to it. My Azure Rules are attached The problem is that a part of the url (/td/22-2/) is dropped ONLY when the user enters a URL without an ending slash and Nginx redirects? them to a path with a slash.
For example, when I type example.net/td/22-2/example/path will give example.net/example/path/ (missing the td/22-2)
I was able to confirm with CURL that /td/22-2/example/path is sent to NGINX with GET, and NGinx returns only /example/path/
server {
listen 8080;
index index.html index.htm;
root /opt/24/www;
gzip on;
#I added this to prevent an issue when running it locally where entering a path without a slash would return a path localhost:8080, instead of 81, which is what my docker container exposes.
absolute_redirect off;
location / {
location ~* /images/*.* {
}
}
}
I’ve tried this, and I only added “absolute_redirect off;” to prevent an issue when running this server via docker on my local machine (docker exposes port 81, while the server uses port 8080)
Read more here: Source link
