﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	uname	nginx_version
501	Incorrect Host HTTP header when using upstream element in location	Antti Huokko		"Hello,

I have a simple load balancing configuration using upstream element. When I use the upstream element in the location element the Host HTTP header is send incorrectly containing the name of the upstream element configuration block.

Here is an example of my configuration. For testing purposes I have configured only single upstream server.

{{{
upstream backend {
  server backend.example.com;
}
}}}

{{{
location /test/ {
  proxy_pass http://backend/;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}}}

With this configuration the HTTP Host header gets value 'backend' instead of the actual server address 'backend.example.com'. I am just wondering how it is possible that Nginx exposes part of the configuration as a HTTP header? Also in my environment it is crucial that the Hots header get send correctly. This is now in fact the only thing that prevents me from replacing Apache as a load balancer with Nginx.

"	defect	closed	major		nginx-core	1.5.x	invalid	upstream HTTP Host header		Linux <HOST-NAME> 2.6.32-431.3.1.el6oso.bz844450v4.x86_64 #1 SMP Mon Jan 27 17:37:39 EST 2014 x86_64 x86_64 x86_64 GNU/Linux	"nginx version: nginx/1.5.10
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
configure arguments: --prefix=/var/lib/openshift/<USER>/app-root/data//nginx --with-pcre=/var/lib/openshift/<USER>/app-root/data//pcre --user=<USER> --group=<USER> --without-mail_pop3_module --without-mail_smtp_module --without-mail_imap_module --without-http_uwsgi_module --without-http_scgi_module --with-debug
"
