-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[nginx] Pass request port to real server #453
Comments
@danielqsj we already pass this information with the header X-Forwarded-Port |
@aledbf Thanks for your reply. client <-> kube-proxy <-> haproxy (used to redirect port, in tcp mode) <-> nginx ingress controller <-> real server Will there be some misconfigurations? |
@aledbf The problem seems that nginx behind tcp mode proxy of haproxy can only see haproxy's IP. And haproxy can not rewrite http head if using tcp mode. |
@danielqsj the problem with
|
@aledbf Great idea. I will fix it. Thank you a lot. |
If nginx ingress controller is behind some loadbalancer like haproxy, which redirect other port (not 80 or 443) to nginx ingress controller.
So request may looks like http://host:port. But nginx set
Host
andX-Forwarded-Host
as$host
, which without port like host. Therefore when real server send redirects to client requests, the url looks like http://host/redirect_url instead of correct url http://host:port/redirect_url.If using
$http_host
instead of$host
, the correct port will be passed to real server.The text was updated successfully, but these errors were encountered: