Joomla 扩展程序卸载导致 502 Bad Gateway

Joomla 扩展程序卸载导致 502 Bad Gateway

我们有一个 VPS,其中有一些 PHP 网站托管在我们的 Ubuntu 12.04 LTS 服务器上,使用 NGINX。在 Joomla 3 网站中,当卸载出错的扩展时,页面会显示带有 502 Bad Gateway 的 NGINX 错误页面,而不是像在 Apache 中那样在 Joomla 中显示错误消息。

错误日志消息产生了一个明显的错误,说明网站为何崩溃,并且可以通过扩展本身轻松修复(PostgreSQL 的数据库连接错误)。

2014/05/06 16:26:12 [error] 17702#0: *26 upstream sent invalid status "0 Error connecting to PGSQL database." while reading response header from upstream, client: xx.xx.xxx.xx, server: sub.example.com, request: "POST /administrator/index.php?option=com_installer&view=manage HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "sub.example.com", referrer: "http://sub.example.com/administrator/index.php?option=com_installer&view=manage"

正如错误指出的那样,这是一个 PostgreSQL 数据库连接错误。

在我的研究中,我发现 502 Bad Gateway 通常是由于配置文件设置不正确造成的。这让我想到,当 Joomla 出现错误时,错误没有得到正确处理并显示 502 错误页面。

我需要知道的是:当发生数据库连接错误时,为什么站点会在 NGINX + PHP-FPM 中出现 502 Bag Gateway 错误?这是 NGINX 和/或 PHP-FPM 中的错误配置,还是这通常是处理错误的方式?

Joomla w/apache 如何处理相同错误的图像:

Joomla 与 apache postgres 连接错误

笔记:我使用了 Joomla 配置http://docs.joomla.org/Nginx

答案1

这可能与无效的状态标头有关,当抛出异常而没有 http 状态代码时,我遇到了同样的问题,因为异常代码会失败:希望它能尽快合并;)您可以暂时手动修补它:https://github.com/joomla/joomla-cms/compare/staging...Mech7:fix-nginx-status?expand=1

相关内容