这是我们第一次设置Nginx和PHP-FPM.一周后我们使用Apache来提供网页,但我们已经决定试用Nginx组合,我们面临着一些问题.
我们有一台运行Ubuntu 14.04 LTS Trusty的虚拟机.在其他实用程序中,该机器正在运行带有PHP-FPM和MySQL的Nginx,这就是问题出现的时候:
我们得出结论,客户端可以连接到Nginx,但是当将请求重定向到FPM(可以通过端口7777访问)时,Nginx没有收到响应并显示超时错误.我们专注于对Nginx和FPM之间的通信进行故障排除,但几个小时后我们还没有找到解决方案.
注意:我们设置的四个虚拟机会重复此问题.
Nginx错误日志(注意:主机名和IP已被抑制)
2014/09/27 01:57:26 [error] 12686#0: *8 upstream timed out (110: Connection timed out) while reading response header from upstream, client: <ip>, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock", host: "<hostname>"
2014/09/27 02:03:26 [error] 12718#0: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: <ip>, server: , request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock", host: "<hostname>"
2014/09/27 02:05:29 [error] 12744#0: *1 upstream timed out (110: …Run Code Online (Sandbox Code Playgroud)