-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for path prefix routing using "X-Forwarded-Prefix" header #22227
Conversation
Note there are no tests for this. I have no idea how we would test this. I also don't know if any Trino clients support this. |
What do we need it for then? |
@losipiuk I was thinking about this this morning, and I think we can do unit tests to verify the correct URL creation. There are 3 areas that I know are affected by this change on the server:
|
Does this add support for hosting Trino as eg |
@findepi yes. That's how I understand this header as well |
core/trino-main/src/main/java/io/trino/server/protocol/ExecutingStatementResource.java
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/server/ExternalUriInfo.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/server/RemoveForwardedPrefixFilter.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/server/ServerMainModule.java
Outdated
Show resolved
Hide resolved
The first call is overwritten by the second call
This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua |
This change allows the server to support routing with a path prefix, enabling better compatibility with reverse proxies and load balancers that use the "X-Forwarded-Prefix" header. This feature is only enabled when `http-server.process-forwarded` is true
Would be great to get this merged and also ideally add some documentation... |
@mosabua I'm not sure if we want to promote this until the clients support it. |
Hm .. does it not work with clients at all or only in the edge case where catalog and schema are specified in the URL .. I kinda think we should document anyway and just say what does and doesnt work |
Description
This change allows the server to support routing with a path prefix,
enabling better compatibility with reverse proxies and load balancers
that use the "X-Forwarded-Prefix" header.
This feature is only enabled when
http-server.process-forwarded
istrue
NOTE: this does not add support to any of the client implementations, and may not work with any existing clients.
Additional context and related issues
Release notes
( ) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
(x) Release notes are required, with the following suggested text: