proxy_set_header host

merlin corey merlincorey at dc949.org
Wed Dec 30 00:09:17 MSK 2009


On Tue, Dec 29, 2009 at 4:27 AM, Francisco Treacy <lists at ruby-forum.com> wrote:
> Igor Sysoev wrote:
>> There is no "ServerName" header. Probably, you need just
>>
>>         location / {
>>              proxy_pass              http://localhost:9090/app/;
>>         }
>>
>
> This is the first thing I tried. Now I updated nginx to 0.7.x and
> $server_name trick doesn't work anymore. It is still unclear to me how
> to obtain the server name as a header.
>
> Btw, it doesn't have to be an "official" HTTP header... anything will do
> as long as I can obtain the "subdomain.domain.com" in my code.
>
> Could you please show me how?
>
> Thanks!
>
> Francisco
> --
> Posted via http://www.ruby-forum.com/.
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>

$http_host and $server_name variables are available for use and you
can pass whatever you want to backend.  Please see documents at
http://wiki.nginx.org/NginxHttpProxyModule#proxy_set_header .

-- Merlin



More information about the nginx mailing list