upstream with fastcgi_pass

jack.wang ysh lists at ruby-forum.com
Fri Mar 18 15:59:28 MSK 2011


I have a problem when use upstream,my config is like this(nginx
version:0.8.54):

    upstream www.a.com {
           server 10.249.200.76:9000;
           server 10.249.200.76:9001;
     }

    server{

         .....

         location ~ \.php$ {
            root           html;
            fastcgi_pass   www.a.com;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/$host
/$fastcgi_script_name;
            include        fastcgi_params;
        }
     }

    and then can success to visit www.a.com;

    but when "fastcgi_pass   www.a.com;" relace  by
    "fastcgi_pass $host;", visit www.a.com is failed.

     I don't know why? can somebody know?

    new config like this:

    upstream www.a.com {
           server 10.249.200.76:9000;
           server 10.249.200.76:9001;
     }

    server{

         .....

         location ~ \.php$ {
            root           html;
            fastcgi_pass   $host;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/$host
/$fastcgi_script_name;
            include        fastcgi_params;
        }
     }

-- 
Posted via http://www.ruby-forum.com/.



More information about the nginx mailing list