-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
use the requested Host header in the proxied request #444
Comments
I can easily fix this, but it may lead to some problems. I believe the reason we decided to change the We need to better test this. If we find out that it can cause problems, then this needs to be a flag when adding the API, like |
Specifically, we need to understand if this is really required: https://github.com/Mashape/kong/blob/master/kong/resolver/access.lua#L179 The fix to this issue would be to comment that line, and add the following nginx directive before the proxy_set_header Host $host; |
as mentioned, I believe both solutions are valid (in different scenarios) therefore, should be flag ... or a feature of request transform plugin |
I have added the |
Former-commit-id: f97f9385bc5effa6d92be5f4279f5b7cd7f9e8d4
When setting up Kong in-front of an API service that relies on the Host header for routing (e.g. Kong itself), Kong uses the
target_url
in the proxied request.it should either:
Host
header all the way through (perhaps this should be the default?)Host
header to be set at the time of creation as an additional property of the API object.alternatively the
request-transformer
plugin could be used here, however, currently attempting to overwrite theHost
header withrequest-transformer
does nothing. (see #445)detailed example:
The text was updated successfully, but these errors were encountered: