今天用docker部署nginx+php環境時,訪問php頁面,提示404錯誤。查看docker日誌發現下面錯誤:php
[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"
1
問題緣由:
php默認監聽的是本地的9000端口nginx
解決方法:
修改php-fpm所在容器的/etc/php-fpm.d/www.conf文件
把listen = 127.0.0.1:9000修改成
listen = 0.0.0.0:9000
---------------------
做者:fogfore
來源:CSDN
原文:https://blog.csdn.net/miwumuge/article/details/83660055
版權聲明:本文爲博主原創文章,轉載請附上博文連接!docker