Problem with map+proxy_pass in 0.6.21

Igor Sysoev is at rambler-co.ru
Sat Dec 15 22:17:52 MSK 2007


On Sat, Dec 15, 2007 at 11:12:49AM -0800, Cliff Wells wrote:

> I've used the map+proxy_pass technique successfully elsewhere, so I
> thought I'd try to use to to proxy to a bunch of OpenVZ virtual servers.
> 
> Each server is also running a copy of Nginx 0.5.x which in turns proxies
> to various applications.  So we have Nginx-0.6.1 -> Nginx-0.5.x -> app.
> 
> I tried with the following:
> 
> map $host $internal_ip {
>     hostnames;
>     101.develix.com  10.10.10.101;
>     102.develix.com  10.10.10.102;
>     103.develix.com  10.10.10.103;
>     # ...
> }
> 
> # ...
> 
> server {
>     listen           198.145.244.138;
>     server_name      107.develix.com;
> 
>     access_log       /var/log/nginx/107.access_log main;
>     error_log        /var/log/nginx/107.error_log info;
> 
>     location / {
>         proxy_pass    http://$internal_ip:80$request_uri;                                                                                          
>         include       /etc/nginx/proxy.conf;
>     }
> }
> 
> 
> The above causes a 500 internal server error with the following in the log:
> 67.189.89.59 - - [15/Dec/2007:04:06:11 -0800] "GET / HTTP/1.1" 500 355 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2007121304 Minefield/3.0b3pre" "-"
> 
> 
> However if I replace the proxy_pass directive with
> 
>          proxy_pass    http://10.10.10.107:80;                                                                                          
> 
> and it works fine.
> 
> 
> Any suggestions or does this look like a bug?

What is in error_log ?


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list