Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

502 Bad Gateway in Server #880

Open
TBWISK opened this issue Mar 27, 2017 · 1 comment
Open

502 Bad Gateway in Server #880

TBWISK opened this issue Mar 27, 2017 · 1 comment

Comments

@TBWISK
Copy link

TBWISK commented Mar 27, 2017

502 Bad Gateway

The proxy server received an invalid response from an upstream server. Sorry for the inconvenience.
Please report this message and include the following information to us.
Thank you very much!

URL: http://code.taobao.org/mailman/listinfo/tengine-cn
Server: taocode-master
Date: 2017/03/27 15:18:16
Powered by Tengine

@mashirozx
Copy link

解析设置不当,查看 /var/log/nginx/error.log 的日志

以我遇到的情况为例

2018/03/10 19:53:56 [crit] 6979#0: *806 connect() to unix:/run/php/php7.1-fpm.sock failed (13: Permission denied) while connecting to upstream, client: 157.119.xxx.xx, server: xxx.com, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.1-fpm.sock:", host: "view.2heng.xin", referrer: "https://xxx.com"

可见原因是 php-fpm 的 Permission denied,所以需要设置 nginx.conf 里的 user,将配置文件第一行

#user  nobody;

改为(www-data 是我的 php 设置)

user www-data;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants