X-Forwarded-Host support

Hi.

Igor, do you plan to add support to the X-Forwarded-Host in nginx?
This can be used in the same way X-Forwarded-For is used in the realip
module.

Thanks Manlio P.

Is the Host header alway change by any proxy servers?

-----ÓʼþÔ­¼þ-----
·¢¼þÈË: [email protected] [mailto:[email protected]] ´ú±í Manlio
Perillo
·¢ËÍʱ¼ä: 2008Äê1ÔÂ5ÈÕ 20:06
ÊÕ¼þÈË: [email protected]
Ö÷Ìâ: X-Forwarded-Host support

Hi.

Igor, do you plan to add support to the X-Forwarded-Host in nginx?
This can be used in the same way X-Forwarded-For is used in the realip
module.

Thanks Manlio P.

On Sat, Jan 05, 2008 at 01:06:16PM +0100, Manlio P. wrote:

Igor, do you plan to add support to the X-Forwarded-Host in nginx?
This can be used in the same way X-Forwarded-For is used in the realip
module.

I do not understand the X-Forwarded-Host use. The realip module is
required
to change IP part of HTTP request on backend side. The “Host” header
line
is HTTP part and it can be easy set on nginx side:

   proxy_pass        http://backend1;
   proxy_set_header  Host   backend2;

and you do not need to do anything on backend side.

On Sun, Jan 06, 2008 at 11:58:25AM +0100, Manlio P. wrote:

set the base url so they can ignore the Host header.
Do you mean to use X-Forwarded-Host on nginx side as
ngx_http_realip_module
does ?

P.S.: X-Real-IP is a private nginx header, or is it used by some other
web servers

X-Real-IP is nginx’s and mod_accel’s header.

Igor S. ha scritto:

is HTTP part and it can be easy set on nginx side:

set the base url so they can ignore the Host header.

Do you mean to use X-Forwarded-Host on nginx side as ngx_http_realip_module
does ?

Yes.

It can be integrated in the ngx_http_realip_module.

I can write a new module, but adding support for X-Forwarded-Host
requires to patch the nginx http core module.

One can also add support for the X-Forwarded-Host in the WSGI
application, of course.

[…]

Regards Manlio P.

Igor S. ha scritto:

   proxy_pass        http://backend1;
   proxy_set_header  Host   backend2;

and you do not need to do anything on backend side.

You are right, but for unknow (to me) reasons some people do not want to
enable the
ProxyPreserveHost On
directive in Apache.

And, quoting from Apache documentation
(mod_proxy - Apache HTTP Server):

This option should normally be turned Off. It is mostly useful in
special configurations like proxied mass name-based virtual hosting,
where the original Host header needs to be evaluated by the backend
server

Some web applications, as an example, explicitly requires that the user
set the base url so they can ignore the Host header.

P.S.: X-Real-IP is a private nginx header, or is it used by some other
web servers

Regards Manlio P.