noi-techpark / odh-mentor-otp

5 stars 8 forks source link

Consolidated solution for indesired redirect caused by reverse proxy #23

Open rcavaliere opened 3 years ago

rcavaliere commented 3 years ago

Related to issue #20, user story aims to find and implement a consolidated solution for this problem

bertolla commented 3 years ago

I finally took some time to look into, and I think I understand the problem a bit better. The current nginx config is:

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

At this point with such an url http://journey.opendatahub.testingmachine.eu/en the nginx server first tries to serve it as file and than as folder doing a forward. He responds to the client with 301 Moved and the location header is http://docker01.testingmachine.eu/en. It ignores the fact to be behind a proxy. To avoid that I added this to the location config: absolute_redirect off;. Seems to work correctly now, but i need to test it.

What I do not understand why the client does a reload in javascript? Surely no big problem but still not beautiful to see.