# 当 Discourse 站点出现 502 Bad Gateway 错误时，是否有分步诊断？

**URL:** <https://meta.discourse.org/t/is-there-a-step-by-step-diagnostic-for-when-a-discourse-site-is-found-in-a-502-bad-gateway/292671>\
**Category:** Self-hosting\
**Created:** [2024 年1 月 23 日 18:15 UTC](https://meta.discourse.org/t/is-there-a-step-by-step-diagnostic-for-when-a-discourse-site-is-found-in-a-502-bad-gateway/292671 "2024-01-23T18:15:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![TonyG](https://avatars.discourse-cdn.com/v4/letter/t/f14d63/32.png) [@TonyG](https://meta.discourse.org/u/TonyG)\
发布日期： [2024 年1 月 23 日 18:15 UTC](https://meta.discourse.org/t/is-there-a-step-by-step-diagnostic-for-when-a-discourse-site-is-found-in-a-502-bad-gateway/292671/1 "2024-01-23T18:15:14Z")

</div>

我来这里是希望能找到一个分步诊断指南，用于处理 Discourse 网站出现 502 Bad Gateway 错误的情况。似乎唯一的选项是：

1. Discourse 更新可能失败，请使用 `./launcher rebuild app`。
2. 更新并重启服务器。

这些是我们从一线技术支持或邮件机器人那里得到的回应。

我们还能做些什么来查看日志并确切了解环境为何崩溃？有了这些信息，我们或许就能学会如何防止将来出现此问题。

例如，是否可以编写一个 cron 进程来偶尔 ping Discourse，如果响应是 502 或类似的返回代码，则自动重建？

重建似乎是一种相当粗暴的解决问题的方法。它不是诊断。

我真的希望有人能为像我这样的菜鸟推荐一份我们可能错过的、关于“诊断 Discourse 问题”的流行文档。🙂

谢谢！

---

_[View the full topic](https://meta.discourse.org/t/is-there-a-step-by-step-diagnostic-for-when-a-discourse-site-is-found-in-a-502-bad-gateway/292671)._
