-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Header X-Forwarded-Prefix not sent when proxying an API #5602
Comments
Adding Request Transformer Plugin configuration for the service(s) is a possible workaround: plugins:
- name: request-transformer
service: echo
config:
add:
headers:
- x-forwarded-prefix:/echo But I would love to not have this additional configuration.... |
Yes, currently we only do:
We don't currently support:
Out of those that we don't have, I think adding |
### Summary Kong currently adds these headers to upstream request: ``` X-Forwarded-For X-Forwarded-Port X-Forwarded-Proto X-Forwarded-Host X-Real-IP ``` @erikgb mentioned that he would like to have `X-Forwarded-Prefix` added on #5602. This PR adds that, and additionally introduces a new PDK function: ```lua local path = kong.request.get_forwarded_path() ``` ### Issues Resolved Close #5602
### Summary Kong currently adds these headers to upstream request: ``` X-Forwarded-For X-Forwarded-Port X-Forwarded-Proto X-Forwarded-Host X-Real-IP ``` @erikgb mentioned that he would like to have `X-Forwarded-Prefix` added on #5602. This PR adds that, and additionally introduces a new PDK function: ```lua local path = kong.request.get_forwarded_path() ``` ### Issues Resolved Close #5602
### Summary Kong currently adds these headers to upstream request: ``` X-Forwarded-For X-Forwarded-Port X-Forwarded-Proto X-Forwarded-Host X-Real-IP ``` @erikgb mentioned that he would like to have `X-Forwarded-Prefix` added on #5602. This PR adds that, and additionally introduces a new PDK function: ```lua local path = kong.request.get_forwarded_path() ``` ### Issues Resolved Close #5602
### Summary Kong currently adds these headers to upstream request: ``` X-Forwarded-For X-Forwarded-Port X-Forwarded-Proto X-Forwarded-Host X-Real-IP ``` @erikgb mentioned that he would like to have `X-Forwarded-Prefix` added on #5602. This PR adds that, and additionally introduces a new PDK function: ```lua local path = kong.request.get_forwarded_path() ``` ### Issues Resolved Close #5602
### Summary Kong currently adds these headers to upstream request: ``` X-Forwarded-For X-Forwarded-Port X-Forwarded-Proto X-Forwarded-Host X-Real-IP ``` @erikgb mentioned that he would like to have `X-Forwarded-Prefix` added on #5602. This PR adds that, and additionally introduces a new PDK function: ```lua local path = kong.request.get_forwarded_path() ``` ### Issues Resolved Close #5602
@erikgb can you please tell me which configuration you are using for kong ? |
I am not sure what you are asking for, but we are using DB-less configuration, and as a workaround before Kong 2.1 (with this issue resolved) we have been using the configuration as described in #5602 (comment) |
I found one https://github.com/hbagdi/deck |
Summary
I would expect Kong to set the
X-Forwarded-Prefix
header when proxying an API. This was registered as issue #1150 and fixed with PR #1180. But it seems like X-Forwarded-Prefix part of this fix has been lost (or removed).I notice the following constant in the code, but it seems unused:
kong/kong/constants.lua
Line 86 in cb1ed39
Steps To Reproduce
Expected behavior
The X-Forwarded-Prefix header is echoed with the value
/echo
.Actual behavior
No X-Forwarded-Prefix header in the echo response
Additional Details & Logs
The text was updated successfully, but these errors were encountered: