0
我部署我的PHP項目作爲在機器A中的Web服務器,使用nginx的和FastCGI,而配置文件是如下:
server {
listen 80;
server_name alpha.kimi.com;
index index.html index.htm index.php;
root /alidata/www/;
location ~ .*\.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location/{
root /www/admin/;
index index.php;
if (!-f $request_filename){
rewrite ^/(.+)$ /index.php?$1& last;
}
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 1h;
}
access_log /data/log/nginx/access/output.log;
error_log /data/log/nginx/access/error.log;
}
所以當我做一個 'GET'請求,從我的本地機器:
curl http://alpha.kimi.com/app/redirect/taskpush?build=10&gcdata=1
會有JSON返回
{"res":200,"msg":"success","extra":[]}
但是,當我在機器A中提出相同的請求時,它只是在那裏掛起,並沒有返回任何東西。我也試過:
curl http://localhost/app/redirect/taskpush?build=10&gcdata=1
和
curl http://localhost:9000/app/redirect/taskpush?build=10&gcdata=1
都不能正常工作。我不知道是什麼問題。
見http://stackoverflow.com/questions/11061788/correct-configuration-for-nginx -to-localhost和http://stackoverflow.com/questions/13634574/how-to-make-nginx-to-listen-to-server-nameport –
你到底是怎麼一直這樣做的? –