Skip to content
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

Host header copied from X-Forwarded-Host (when forwarded headers are enabled) #3790

paovitali opened this issue Feb 21, 2019 · 0 comments


Copy link

commented Feb 21, 2019

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see No

What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.): nginx, ingress, forwarded, x-forwarded-host


NGINX Ingress controller version: 0.22

Kubernetes version (use kubectl version): 1.10.5

Environment: Bare Metal

  • Cloud provider or hardware configuration: Bare Metal
  • OS (e.g. from /etc/os-release): Ubuntu 16.04.3 LTS
  • Kernel (e.g. uname -a): 4.4.0-109-generic
  • Install tools: Puppet

What happened:
With reference to these past issue (went stale/closed with no action):


I am still seeing, when applying to a nginx controller deploy the configmap key use-forwarded-headers: "true" , that the Host header gets populated with values from X-Forwarded-Host. This leads to issues when applications/components that are receiving traffic from controller are not able to evaluate an array of values in the Host header e.g.:Host=<host..1>,<host..2>,<host..n>.

What you expected to happen: the Host header must never be rewritten or contain duplicated values from other headers, expecially the X-Forwarded-Host.

How to reproduce it (as minimally and precisely as possible): Fire up a 0.22 nginx ingress controller with cfm use-forwarded-headers: "true" and check the value of Host header on an upstream pod receiving traffic.

Anything else we need to know: The template snippet involved in the above described actions:

nginx map activated when use-forwarded-headers: "true"

map $http_x_forwarded_host $best_http_host {
        default          $http_x_forwarded_host;
        ''               $this_host;

@paovitali paovitali changed the title Host header copied from X-Forwarded-Host when forwarded headers are enabled Host header copied from X-Forwarded-Host (when forwarded headers are enabled) Feb 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.