I'm proxying a Spring REST backend like so:
Backend:
http://backend:8080
Proxied localhost:
localhost:3000/api/backend -> http://backend:8080
If I browse locally to a proxied endpoint, it will proxy the request, the links, however, do not include the proxy path, i.e.
GET localhost:3000/api/backend/people
"href": "http://localhost:3000/people"
I would expect this to be:
"href": "http://localhost:3000/api/backend/people"
There any way to fix this?
Thanks!
You should have a look at the x-forwarded-*
headers your proxy is adding to the request.
If the request from your proxy to the backend contains the header x-forwarded-prefix=/api/backend
spring will pick up the prefix and add it to the generated link.
You do not mention which proxy are you using so I cannot tell if your proxy supports adding the x-forwarded-prefix
header.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With