Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reverse proxy url fix #1995

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

klopfdreh
Copy link
Contributor

@klopfdreh klopfdreh commented Apr 3, 2024

UI accessed over reverse-proxy: http://reverse-proxy-url:443/scdf/
Actual backend url: http://somedomain.de:8080/scdf/

If you access _links the actual backend is rendering those as http://somedomain.de:8080/scdf/tasks/logs/mytask?platformName=default&schemaTarget=boot2

This PR is going to exchange the protocol / host / port from the one of the reverse proxy so that it is going to look like this http://reverse-proxy-url:443/scdf/tasks/logs/mytask?platformName=default&schemaTarget=boot2

So somedomain.de is replaced with reverse-proxy-url, 8080 is replaced with 443 and http with http

If the server does not run behind a reverse proxy nothing is going to be changed - for the tests I wrapped the url into a try catch as there is no protocol / domain / port present.

Edit: fixes: #1994

@klopfdreh
Copy link
Contributor Author

Hint: As there are no other places which use _links from backend this change should be fine. If there are other occurrences the new function can be used there as well.

@klopfdreh
Copy link
Contributor Author

Hey @claudiahub / @oodamien - what do you think about that fix? We recently tested it and it works behind reverse proxy and direct access without changes to the backend.

Copy link
Contributor

@claudiahub claudiahub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@klopfdreh looks good to me, thank you
it seems there are no other places where we use _links from backend.

@klopfdreh
Copy link
Contributor Author

klopfdreh commented May 15, 2024

Hey @claudiahub - @onobc just asked me if I could provide an opt-in setting for the reverse proxy fix which can be activate through the settings page. I force pushed the changes to this PR. Here is how the ui looks like, now:

Bildschirmfoto 2024-05-15 um 23 59 24

The default behavior is deactivated. Can you check if everything is working for you properly?

@oodamien oodamien self-requested a review May 16, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

View logs if spring-cloud-data-flow-server is running behind a reverse proxy is not possible
3 participants