nginx访问502 gateway,*1 connect() failed (111: Connection refu
发布时间:2021-01-17 08:21:42 所属栏目:Nginx 来源:互联网
导读:安装好nginx,php环境后,配置虚拟主机,结果访问后就报502 gateway,查看日志文件后,显示错误如下: 解决方案,先查看下php-fpm是否启动,然后查看虚拟主机配置中的 root 配置
|
安装好nginx,php环境后,配置虚拟主机,结果访问后就报502 gateway,查看日志文件后,显示错误如下: 2019/04/29 16:24:39 [error] 19433#19433: *1 connect() failed (111: Connection refused) while connecting to upstream,client: 192.168.1.52,server: 192.168.1.222,request: "GET / HTTP/1.1" 解决方案,先查看下php-fpm是否启动,然后查看虚拟主机配置中的 root 配置 server {
listen 80;
server_name 192.168.1.222;
charset utf-8;
location / {
root /data/wwwroot;
index index.php index.html index.htm;
}
location ~ .php$ {
#注意这里root配置与当前server下的root保持一致
#我的报错原因是我把root这项给删除
root /data/wwwroot;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
然后重启下nginx就可以访问了。 (编辑:日照站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- if-statement-仅在存在cookie的情况下如何有条件地覆盖ngin
- python – Django – 部署与Gunicorn,Nginx和主管,Gunicorn
- ruby-on-rails – 如何配置nginx以在SubURI上提供gitlabhq
- 如何在NGINX中设置自定义的503错误页面?
- 如何以非root用户身份运行gunicorn/python app服务器?
- 从nginx上的访问日志中隐藏获取参数
- Nginx将proxy_pass服务器重定向到http://server/index.htm
- Newrelic插件Nginx-nr-agent无法正常工作
- nginx – Magento产品图片未显示在后端
- 网络 – Nginx:直接在text / plain中返回$remote_addr
推荐文章
站长推荐
热点阅读
