0 0

nginx+tomcat broken pipe异常5

nginx + tomcat,客户端下载一个200k的txt数据时,在tomcat端会报  broken pipe错误。

单独使用tomcat正常。加上nginx报错。




response.setContentType("multipart/form-data");
        response.setHeader("content-disposition", "attachment;filename=" + filename);
        OutputStream os = null;
        try {
	        os = response.getOutputStream();
	        byte[] b=new byte[1024];
	        int length;
	        while((length=inputStream.read(b))>0){
	        	os.write(b, 0, length);
	        }
        } finally {
        	if(os != null)
        		os.close();
        	if(inputStream != null)
        		inputStream.close();
        }
2014年9月04日 19:58

1个答案 按时间排序 按投票排序

0 0

我最近也遇到了这个问题,不知道是老机器还是nginx的问题,机器不在同一个机房,换代理有点麻烦;

2014年11月20日 22:24

相关推荐

Global site tag (gtag.js) - Google Analytics