繁体   English   中英

Nginx错误导致502 Bad Gateway错误

[英]Nginx Error is Resulting in 502 Bad Gateway

我有一个正在运行Ubuntu的AWS EC2实例。 当我进入错误日志时,我就在这里。 这是什么意思,我该如何解决?

这来自我的error.log文件:

2019/09/05 18:01:02 [crit] 991#991: *46 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 64.223.223.8, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "thewildwear.com"

您的Nginx服务器无法与php7.2-fpm通信,或者路径/var/run/php/php7.2-fpm.sock无效或php7.2-fpm没有运行。

检查PHP是否正在运行。

sudo systemctl status php7.2-fpm

验证路径是否存在ls -l /var/run/php/php7.2-fpm.sock

如果不存在,请尝试在php cd /var/run/php/下找到确切的文件,然后您会看到ls

php7.*-fpm.pid  php7.*-fpm.sock

更新/etc/nginx/sites-available/default并更改为"fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;" 行到“ fastcgi_pass unix:/var/run/php/php7.{after ls}-fpm.sock;"

您可以在此处查看GitHub 问题

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM