crnk-framework icon indicating copy to clipboard operation
crnk-framework copied to clipboard

Issues overriding domain name

Open spanishkangaroo opened this issue 3 years ago • 2 comments

Our services are always behind a proxy, so we had a problem within the links section, as it was showing reference to the original hostname, not the proxy. E.g.

 "links": {
                        "self": "https://backend-server-instead-of-proxy.com/waste/entity/57ACE9FD-D796-B6BE-3B5C-B0311AD555A7/relationships/entityType",
                        "related": "https://backend-server-instead-of-proxy.com/waste/entity/57ACE9FD-D796-B6BE-3B5C-B0311AD555A7/entityType"
                    }

We tried to solve by using the following property

crnk.config.core.resource.domain

as per the official documentation, but it did not work, the URLs where still showing the backend hostname.

Finally, after some debugging, we managed to make it show proxy URLs by defining the property

crnk.domain-name=https://proxy-hostname.com

but it looks like a dirty hack.

Is this the expected behaviour? Are we missing something? We are just using the latest version of the crnk spring boot 2 library.

spanishkangaroo avatar May 21 '21 07:05 spanishkangaroo

if the proxy properly forwards host and x-forward-proto headers, no configuration should be necessary.

remmeier avatar May 23 '21 11:05 remmeier

Thank you, we will check the header forwards and keep this issue updated.

spanishkangaroo avatar May 26 '21 08:05 spanishkangaroo