问题现象

图片-1657864688254

打开控制台发现是/sync接口没有响应,nginx上面查看日志,显示连接拒绝

2022/07/14 23:23:03 [error] 475123#0: *2447438 connect() failed (111: Connection refused) while connecting to upstream, client: 1.1.1.1, server: xxx.xxx.app, request: "GET /sync?v=1987667&id=10bb0722 HTTP/2.0", upstream: "http://127.0.0.1:3000/sync?v=1987667&id=10bb0722", host: "xxx.xxx.app", referrer: "https://xxx.xxx.app/"

解决方案

往nginx反向代理块中添加以下路由

location /sync {
    proxy_set_header Cache-Control: no-cache;
    chunked_transfer_encoding off; 
    proxy_cache off;
    proxy_buffering off;
    proxy_set_header Connection keep-alive;
    proxy_pass http://127.0.0.1:3000/sync;
}

初步怀疑是走了缓存导致的,添加之后就可以打开了

图片-1657864876303

文章作者: Mystery0
版权声明: 本站所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Mystery0の小站
流水账记录 踩坑 记录
喜欢就支持一下吧