Docker里两个php容器一个正常访问,一个出现502 Bad Gateway nginx/1.17.8。
问题描述
Docker里两个php容器一个镜像是phpfpm5.6,运行的程序是emlog,正常访问。一个镜像是phpfpm7.3,运行的程序是wordpress,运行的出现502 Bad Gateway nginx/1.17.8。
问题出现的平台版本及自己尝试过哪些方法
系统是centos7.6
对应容器内有wordpress程序
相关代码(日志)
nginx最新一次错误日志日志:
{"log":"2020/03/27 09:44:10 [error] 6#6: *72 connect() failed (111: Connection refused) while connecting to upstream, client: 000.000.000.000, server: blog.000000.xyz, request: "GET / HTTP/1.1", upstream: "fastcgi://172.19.0.4:9004", host: "blog.000000.xyz"n","stream":"stderr","time":"2020-03-27T09:44:10.201216128Z"}
{"log":"000.000.000.000 - - [27/Mar/2020:09:44:10 +0000] "GET / HTTP/1.1" 502 559 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.100 Safari/537.36" "-"n","stream":"stdout","time":"2020-03-27T09:44:10.201273369Z"}
nginx.conf配置文件(wordpress部分)
`server {
listen 443 ssl;
server_name blog.000000.xyz;
root /wordpress;
index index.html index.htm;
ssl_certificate /ssl/blogssl.pem;
ssl_certificate_key /ssl/blogssl.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
root /wordpress;
index index.php index.html index.htm;
}
location ~\.php(.*)$ {
root /wordpress;
fastcgi_pass 172.19.0.4:9004;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /wordpress$fastcgi_script_name;
fastcgi_param PATH_INFO $1;
include fastcgi_params;
}
} `
php-fpm7.3运行日志
{"log":"[27-Mar-2020 04:10:15] NOTICE: fpm is running, pid 1n","stream":"stderr","time":"2020-03-27T04:10:15.920559488Z"}
{"log":"[27-Mar-2020 04:10:15] NOTICE: ready to handle connectionsn","stream":"stderr","time":"2020-03-27T04:10:15.920615726Z"}
我先安装的是emlog, wordpress还未曾运行成功。
已尝试的解决办法
nginx等待时间超时
PHP FastCGI进程数是否够用,已执行netstat -anpo | grep "php-cgi" | wc -l
,输出结果是0
问题以及期望的结果
请问要怎样才能正常访问wordpress程序?
会不会是我的nginx配置文件错了呢?
或者是服务器配置过低跑不起来两个php?
(有部分隐私信息我用0替代了,请见谅)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)