Title: One line description
Enable applications that support the X-Forwarded-Prefix header to generate working links when an ingress proxy has rewritten the context path to root.
Description:
It is common to have an application responsible for only one context path of a domain; e.g. example.com/foo/* should be routed to myapp. However, myapp serves content on /, not /foo, because the application shouldn't have to know the client-facing context path. So the ingress proxy is configured to rewrite the path from /foo/* to /*. However, since the app doesn't know that this rewrite has occurred, it is unable to generate working self-referential link in responses, e.g. the app would return a link to /products instead of /foo/products.
The X-Forwarded-Prefix header provides the path that was stripped by the proxy.
App devs told me that this header is supported by Spring Boot, which helps with automation of link generation.
We do already write the original path in x-envoy-original-path. I assume this is not sufficient?
I was not aware, thank you for your reply.
While X-Envoy-Original-Path may provide the same function, it is not likely to have the same support in Spring or other frameworks as X-Forwarded-Prefix does. I’ll look into it a bit further and post an update or close this issue.
On Jan 7, 2019, at 6:55 PM, Matt Klein notifications@github.com wrote:
We do already write the original path in x-envoy-original-path. I assume this is not sufficient?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
There is a standard HTTP header for this https://tools.ietf.org/html/rfc7239#section-4.
Good call. A standard header will likely be an easier sell with the framework communities, like Spring, than an Envoy-specific one. But, requires changes on both sides.
On Jan 9, 2019, at 5:58 PM, Rossen Stoyanchev notifications@github.com wrote:
There is a standard HTTP header for this https://tools.ietf.org/html/rfc7239#section-4.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
Actually never mind the link to the RFC. The Forwarded header is for the host, port, and protocol. This request is for the path prefix.
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
Are there any plans to support X-Forwarded-Prefix-header in the future?
As far as I can see, it is not possible, to dynamically add this with add_request_headers, because there is no dynamic value for this (like %DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%)?
Most helpful comment
Are there any plans to support
X-Forwarded-Prefix-header in the future?As far as I can see, it is not possible, to dynamically add this with
add_request_headers, because there is no dynamic value for this (like%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%)?