proxy pass variable host

Vladislav Vorobiev mymir.org at googlemail.com
Mon Oct 20 02:15:25 MSD 2008


> Добрый день,
>
> кто подскажит почему не работает конструкция типа (nginx-0.7.19)
>
> server {
>        listen       80;
>        server_name  lala.host *.lala.host;
>        proxy_pass
>        http://localhost:8090/VirtualHostBase/http/$host:80/path/VirtualHostRoot/;
>        }
> }
>
> без переменной host работает прекрасно!
>
> в логах 502
>
> 87.234.147.2 - admin [19/Oct/2008:14:22:06 +0200] "GET / HTTP/1.1" 502
> 173 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1)
> Gecko/2008071
> 87.234.147.2 - admin [19/Oct/2008:14:22:08 +0200] "GET /fsd HTTP/1.1"
> 502 173 "-"
>
> и
>
> 2008/10/19 14:40:36 [error] 25858#0: *502 no resolver defined to
> resolve localhost, client: XX.234.147.2, server:  lala.host, request:
> "GET /fsd HTTP/1.1", host: " lala.host"
>
> resolver это же для
> proxy_pass  $request; ?
>
> Мне нужно чтобы он на все  *.lala.host реагировал.
>
>
>
> а apache было так
>
> <VirtualHost *>
> ServerName lala.host
> ServerAlias *lala.host
> RewriteEngine On
> RewriteRule ^/(.*)
> http://localhost:8090/VirtualHostBase/http/%{HTTP_HOST}:80/path/VirtualHostRoot/$1
> [L,P]
> </VirtualHost *>

Спасибо за внимание, после ужина дошло

http://127.0.0.1:8090/VirtualHostBase/http/$host:80/geoproject/VirtualHostRoot/$uri;


More information about the nginx-ru mailing list