You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

DigitalOcean Linux环境Chatwoot自定义仓库安装后Nginx 502错误求助

排查Chatwoot安装后Nginx 502 Bad Gateway错误的步骤

1. 先查Chatwoot核心服务状态

执行命令确认Chatwoot的web和sidekiq服务是否正常运行:

sudo systemctl status chatwoot.target

要是服务没启动,先重启试试:

sudo systemctl restart chatwoot.target

再看详细日志找启动失败的原因:

sudo journalctl -u chatwoot-web -f
sudo journalctl -u chatwoot-sidekiq -f

2. 验证自定义仓库代码的兼容性

  • 确认你的Git仓库代码是基于官方Chatwoot稳定分支(比如main)修改的,别改崩了依赖或服务启动逻辑。
  • 打开项目根目录的.env文件,检查RAILS_ENV、REDIS_URL、DATABASE_URL这些关键配置有没有写错。

3. 检查Nginx配置和后端端口连通性

  • 找到Chatwoot的Nginx配置文件(一般在/etc/nginx/sites-available/chatwoot.conf),确认proxy_pass指向的端口(默认3000)是对的,然后在服务器本地测试能不能访问这个端口:
curl http://localhost:3000

如果curl连不上,说明Chatwoot web服务没在监听这个端口,回到第一步接着查服务启动问题。

4. 排查端口占用和防火墙

  • 看看3000端口(或者你自定义的端口)有没有被别的进程占了:
sudo lsof -i :3000
  • 检查服务器ufw防火墙状态,确保本地能访问3000端口,外部能访问80/443端口:
sudo ufw status

5. 确认依赖服务正常

Chatwoot靠Redis和PostgreSQL跑,先查这俩服务状态:

sudo systemctl status redis-server
sudo systemctl status postgresql

要是有异常,重启对应服务再看日志:

sudo systemctl restart redis-server
sudo journalctl -u redis-server -f

6. 检查安装目录权限

确保Chatwoot安装目录(默认/home/chatwoot)的所属用户是chatwoot,权限没乱:

ls -ld /home/chatwoot
sudo chown -R chatwoot:chatwoot /home/chatwoot

内容的提问来源于stack exchange,提问作者kbza dev

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.03 05:40:24