spring-cloud-dataflow-ui icon indicating copy to clipboard operation
spring-cloud-dataflow-ui copied to clipboard

fix: reverse proxy url fix

Open klopfdreh opened this issue 1 year ago • 3 comments

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: https://github.com/spring-cloud/spring-cloud-dataflow-ui/issues/1994

klopfdreh avatar Apr 03 '24 10:04 klopfdreh

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 avatar Apr 03 '24 10:04 klopfdreh

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.

klopfdreh avatar Apr 07 '24 19:04 klopfdreh

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?

klopfdreh avatar May 15 '24 22:05 klopfdreh

@cppwfs / @corneil - any chance to get this into 2.11.5?

klopfdreh avatar Aug 05 '24 17:08 klopfdreh

Thanks for the contribution @klopfdreh !

Closing via https://github.com/spring-cloud/spring-cloud-dataflow-ui/commit/f0f082035623bf91702d57f24b93adc012716b93

onobc avatar Sep 12 '24 19:09 onobc