电脑技巧 OpenClaw Nginx 报错:反代控制台偶发 502 Bad Gateway 如何调整 Node.js 的 Keep-Alive 超时时间? 作者提米哥 2026年3月7日 如果 18789 端口在本地 curl 正常,但 Nginx 经常报 502,通常是因为 Node.js 的 Keep-Alive 超时时间小于 Nginx 的配置,导致 Node 主动断开连接而 Nginx 还在往里发请求。请在 `config.json` 的 `server` 节点中,将 `keep_alive_timeout` 显式设为 `65000`(65秒),并在 Nginx 配置中保持 `keepalive_timeout 60s;`,确保 Nginx 率先断开。