用docker部署nginx+php环境时,访问php文件不执行
今天用docker部署nginx+php环境时,访问php页面,提示404错误。查看docker日志发现下面错误:[error] 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.248.1, server: 115.182.68.147, reques.
·
今天用docker部署nginx+php环境时,访问php页面,提示404错误。查看docker日志发现下面错误:
[error] 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.248.1, server: 115.182.68.147, request: "GET /test.php HTTP/1.1", upstream: "fastcgi://172.18.0.2:9000", host: "192.168.248.129"
问题原因:
php默认监听的是本地的9000端口
解决方法:
修改php-fpm所在容器的/etc/php-fpm.d/www.conf
文件
把listen = 127.0.0.1:9000
修改为
listen = 0.0.0.0:9000
更多推荐
已为社区贡献1条内容
所有评论(0)