Problem with map+proxy_pass in 0.6.21

Cliff Wells cliff at
Sat Dec 15 22:12:49 MSK 2007

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 {
    # ...

# ...

server {
    listen ;

    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: - - [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


and it works fine.

Any suggestions or does this look like a bug?


More information about the nginx mailing list