Http failure response for : 504 Gateway Time-out

网关请求超时
分布式项目中用到了websocket的请求功能
因为后端长时间的处理数据 导致前端连接超时 后端处理完数据 前端连接已经断开了 数据结果返显不出来
经常在ie浏览器中出现 谷歌没碰到过。

解决方案:
前端服务器扩大http超时时间设置
例如:nginx 的
  location ~ /xx {
    proxy_pass  http://127.0.0.1:8080;
    proxy_read_timeout  3600;
}
一般到这里就可以了
如果还不行的话再在网关的服务配置上增加超时的设置

zuul:
  routes:
    xx:
      path: /xx/**
      serviceId: xx-service
  sensitive-headers: Cookie,Set-Cookie
  host:
    #针对url访问方式的超时设置
    socket-timeout-millis: 100000
    connect-timeout-millis: 100000

posted @ 2022-09-16 16:26  D·Felix  阅读(266)  评论(0编辑  收藏  举报