Preserving all original request headers through a proxy_pass ?

Maxim Dounin mdounin at mdounin.ru
Fri Dec 31 02:27:38 MSK 2010


Hello!

On Thu, Dec 30, 2010 at 04:56:00PM -0500, elgreco wrote:

> I dont know if i can ask in the same topic my question...

General rule is: don't hijack threads.

> i have a upstream of two servers which responds on host headers only
> (apache virtualhost's)
> when i try to open the www.server.local (which is nginx  frontend) i get
> only default web pages from backends and not the web1 or web2
> what should i do to fix the problem ?
> 
> upstream backend {
>                 server web1.local.com:80;
>                 server web2.local.com:80;
>         }
>         server {
> 
>       listen 80;
>          server_name www.domain.local;
>             location / {
>               proxy_pass  http://backend;
>               proxy_set_header        Host            $host;
>             }
>     }

Most likely you don't have "www.domain.local" configured as 
virtualhost on your backends, and that's why it doesn't work.

Maxim Dounin



More information about the nginx mailing list