参考:http://www.oicto.com/nginx_fastcgi_php_file_get_contents/
模拟支付接口回调测试,在本地用curl 请求本地的地址 总是超时 timeout curl_errno 为 28
而实际上被请求的程序已经被执行(access log 有记录、执行日志有更新)
解决方法:
开多个不同端口的cgi进程,利用nginx upstream 模块处理
http {
...
# upstream bakend 多个fastcgi进程 不同端口 均等的处理
upstream bakend {
server 122.0.0.1:9000 weight = 5 max_fails=0 fail_timeout=30s;
server 127.0.0.1:9001 weight = 5 max_fails=0 fail_timeout=30s;
}
...
}
location ~ \.php {
# 应用 bakend
fastcgi_pass bakend;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}