gpt4 book ai didi

Nginx 说明 "502 Bad Gateway"

转载 作者:行者123 更新时间:2023-12-02 03:35:27 25 4
gpt4 key购买 nike

好的,我在本地运行一个应用程序 homestead.app:8000。我正在运行 Vagrant,这只是在我执行“vagrant halt”更改 Nginx 的文档根目录然后 vagrant up 之后才开始发生。

Nginx 将 502 Bad Gateway 返回到浏览器,我的测试域的错误日志指出以下内容:

2014/05/18 21:37:11 [crit] 1368#0: *7 connect() to unix:/var/run/php5-fpm.sock 在连接到上游时失败(2:没有这样的文件或目录),客户端:10.0.2.2,服务器:homestead.app,请求:“GET/HTTP/1.1”,上游:“fastcgi://unix:/var/run/php5-fpm.sock:”,主机:“homestead.app” :8000"

最佳答案

确保 php-fpm 正在运行。我遇到了类似的问题,所以最后我将默认的 php-fpm 端口从 9000 更改为 8999 并从 nginx.conf 文件中踢出套接字信息(替换为主机和端口号)。就我而言,这是有效的:

location ~ \.php {
fastcgi_pass 127.0.0.1:8999;
fastcgi_index /index.php;

include /usr/local/etc/nginx/fastcgi_params;

fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_read_timeout 600;
}

关于Nginx 说明 "502 Bad Gateway",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23728977/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com