由nginx缓冲导致的:java.io.IOException: Connection reset by peer & java.io.IOException: Broken pipe

出现场景:文件上传超过1M,后发现下载超过5M也存在问题。

问题原因:使用 Java NIO 建立 Socket 服务端,当客户端意外关闭的情况,不是发送指定指令通知服务器退出。由于本地、测试环境功能正常,经过尝试基本定位nginx缓冲区设置过小导致。(小声bb,这个nignx也不是我们布置的,是服务器管理方布置的)

解决方案:关闭缓冲区 nginx.config文件中加入proxy_buffering off

参考:https://www.cnblogs.com/FlyAway2013/p/10580594.html

猜你喜欢

转载自blog.csdn.net/qq_16253859/article/details/106833282
今日推荐