三台服务器
主 174 装 NGINX
从 170,191 装 PHP
三台服务器防火墙和 SELINUX 都已经关闭了
主服务器装好 Nginx 后,直接访问能看到欢迎页面
从服务器装好 php 后,直接用 PHP -S ip:port 启动,访问能看到正常页面
三台服务器的 /home/wwwroot 目录下分别有几个相同的测试文件
主服务器 174
nginx/conf.d/default.conf
upstream myServer{
server 192.168.199.191:9000 max_fails=3 fail_timeout=10s;
server 192.168.199.170:9000 max_fails=3 fail_timeout=10s;
}
server {
listen 80;
server_name 192.168.199.174;
location / {
root /home/wwwroot;
index index.html index.htm;
}
location ~ \.php$ {
root /home/wwwroot;
fastcgi_pass myServer;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
从服务器 170 191
/usr/local/etc/php-fpm.d/www.conf
[www]
; 担心是用户权限问题,所以把 nobody 改成了 root
; 用 php-fpm -R 启动
user = root
group = root
listen = [::]:9000
listen.allowed_clients = any
request_terminate_timeout = 0
但最终结果是:
2017/07/13 10:28:10 [error] 2199#2199: *10 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.199.222, server: 192.168.199.174, request: "GET /1.php HTTP/1.1", upstream: "fastcgi://192.168.199.191:9000", host: "192.168.199.174"
2017/07/13 10:28:10 [warn] 2199#2199: *10 upstream server temporarily disabled while reading response header from upstream, client: 192.168.199.222, server: 192.168.199.174, request: "GET /1.php HTTP/1.1", upstream: "fastcgi://192.168.199.191:9000", host: "192.168.199.174"
2017/07/13 10:28:10 [error] 2199#2199: *10 upstream prematurely closed connection while reading response header from upstream, client: 192.168.199.222, server: 192.168.199.174, request: "GET /1.php HTTP/1.1", upstream: "fastcgi://192.168.199.170:9000", host: "192.168.199.174"
2017/07/13 10:28:10 [warn] 2199#2199: *10 upstream server temporarily disabled while reading response header from upstream, client: 192.168.199.222, server: 192.168.199.174, request: "GET /1.php HTTP/1.1", upstream: "fastcgi://192.168.199.170:9000", host: "192.168.199.174"
求问,毛病出在那里?
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.