Closed klopfdreh closed 2 months ago
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.
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.
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:
The default behavior is deactivated. Can you check if everything is working for you properly?
@cppwfs / @corneil - any chance to get this into 2.11.5?
Thanks for the contribution @klopfdreh !
Closing via https://github.com/spring-cloud/spring-cloud-dataflow-ui/commit/f0f082035623bf91702d57f24b93adc012716b93
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 withreverse-proxy-url
,8080
is replaced with443
andhttp
withhttp
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: https://github.com/spring-cloud/spring-cloud-dataflow-ui/issues/1994