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

Nginx无法检测后端服务上下线问题求助

Nginx后端恢复后仍持续返回504 Gateway Timeout问题

我们使用Nginx部署UI应用时遇到如下问题:

  • 后端服务故障时,Nginx返回504 Gateway Timeout,符合预期
  • 但后端服务恢复后,Nginx依旧返回504错误,无法自动检测到服务已恢复

尝试过的Nginx配置如下:

location ~ ^/(hub/note|rest/api/note) {
    proxy_pass http://localhost:8011;
    proxy_buffering off;
    proxy_http_version 1.1;
    proxy_set_header Host $http_host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_cache_bypass $http_pragma;
    proxy_no_cache $http_pragma;
    proxy_cache off;
    proxy_cache_use_stale off;
    proxy_connect_timeout 180s;
    proxy_read_timeout 180s;
    proxy_send_timeout 180s;
}

更新: 执行nginx -s reload重新加载Nginx配置后,连接恢复正常。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.20 05:40:31