-
Notifications
You must be signed in to change notification settings - Fork 98
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
Incorrect host returned for request with port #797
Comments
I assume the infra-backend-v1 backendRef specified in the example is pointing to an API on our control plane that is returning this info? So we would need to modify our API to include the port number? |
infra-backend-v1 is a Pod in the cluster. The example is showing debug output from an HTTP request to NKG for the host |
we pass the host header to the backend using the value of $host NGINX variable. However, that value doesn't include anything after including However, note that Consider the following NGINX server:
And requests/responses:
see also http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host and https://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_ |
@pleshakov thanks for the details. So it sounds like we can't reliably use |
@kate-osborn At the same time, we can also use the value of map $http_host $gw_api_compliant_host {
'' $host; # This can happen in an HTTP/1.0 request. NGINX will set $host to something, so let's use that value. See http://nginx.org/en/docs/http/ngx_http_core_module.html#var_host
default $http_host; # use the host header unmodified as prescribed by the Gateway API.
}
...
location / { proxy_set_header Host $gw_api_compliant_host; ... } |
The HTTPRouteHostnameIntersection conformance test fails one test case because the host returned does not match the host sent.
The request's host is
very.specific.com:1234
and nginx returnsvery.specific.com
. Note that we are routing the request to the correct backend.Error:
expected host to be very.specific.com:1234, got very.specific.com (after 29.1768454s)
Acceptance Criteria:
The text was updated successfully, but these errors were encountered: