2011年3月18日星期五

upstream with fastcgi_pass

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/.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx

没有评论:

发表评论