Net::ERR_INCOMPLETE_CHUNKED_ENCODING问题跟踪,顺藤摸找出解决方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_35624642/article/details/79104353
最近项目用Nginx做反向代理,项目放在Linux上没出来数据,在Windows server上可以出来,于是加载时打开了浏览器控制台,看到 

Net::ERR_INCOMPLETE_CHUNKED_ENCODING从字面上理解的话应该是响应被截断了。

进一步深入可能是Nginx的配置问题, 找到Nginx的日志文件查看,看到了报错原因, open() "/usr/local/nginx-1.8.0//proxy_temp/8/01/0000000018" failed (13: Permission denied) while reading upstream, client: 10.111.42.173, server: localhost, request: "POST /API/autoops/PZTrademarkREST/getAll HTTP/1.1", upstream: "http://127.0.0.1:9999/API/autoops/PZTrademarkREST/getAll", host: "10.111.76.180:9998", referrer: "http://10.111.76.180:9998/"

问题原因

当代理文件大小超过配置的proxy_temp_file_write_size值时,nginx会将文件写入到临时目录下(默认为/proxy_temp)。

如果nginx对/proxy_temp没有权限,就写不进去。

解决

调整/proxy_temp权限为配置nginx的那个用户。

chown -R www:www /usr/local/nginx/proxy-temp


总结:做程序开发,遇到问题不需要慌,不要像无头苍蝇一样到处乱飞,而要从问题出发,顺腾摸瓜,找到最终的问题,就找到解决方法了,就像门被锁了,钥匙肯定在别的地方,不会插在锁里一样。(因为看同事们在哪搞了一个早上也没解决,像无头苍蝇一样到处乱飞,最后我找到原因很快解决了)




net::ERR_INCOMPLETE_CHUNKED_ENCODING(failed)

03-25

用flash请求一个http请求,返回 json结构的数据,用火狐访问没问题,用谷歌浏览器内核的访问就报net::ERR_INCOMPLETE_CHUNKED_ENCODING(failed),请问大神这是什么问题呀?服务器用了代理nginx。主网站用的JAVA语言,spring 的mvcrn用Wireshark截取的tcp数据流,也没发现有什么异常。rn谷歌内核的数据流如下[code=html]rnrnGET /flash_data.do?t=0%2E5859917909838259 HTTP/1.1rnHost: 隐藏,,不显示rnConnection: keep-alivernPragma: no-cachernCache-Control: no-cachernAccept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8rnUpgrade-Insecure-Requests: 1rnUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36rnAccept-Encoding: gzip, deflate, sdchrnAccept-Language: zh-CN,zh;q=0.8rnCookie: JSESSIONID=936704B6BDD3E3E8ADFDC568F869A5D4; _ga=GA1.2.1200210736.1489049029rnrnHTTP/1.1 200 OKrnServer: Tengine/2.1.2rnDate: Fri, 24 Mar 2017 07:20:33 GMTrnContent-Type: application/json;charset=UTF-8rnTransfer-Encoding: chunkedrnConnection: keep-alivernVary: Accept-Encodingrnrne9rn"next":.......数据内容省略.....rn[/code]rn火狐浏览器的TCP数据流rn[code=html]rnGET /flash_data.do?t=0%2E5859917909838259 HTTP/1.1rnHost: 隐藏,,不显示rnUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0rnAccept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8rnAccept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3rnAccept-Encoding: gzip, deflaternCookie: _ga=GA1.2.834559415.1490249495rnConnection: keep-alivernUpgrade-Insecure-Requests: 1rnCache-Control: max-age=0rnrnHTTP/1.1 200 OKrnServer: Tengine/2.1.2rnDate: Fri, 24 Mar 2017 07:20:35 GMTrnContent-Type: application/json;charset=UTF-8rnTransfer-Encoding: chunkedrnConnection: keep-alivernVary: Accept-Encodingrnrne9rn"next":.......数据内容省略.....rn[/code] 论坛

没有更多推荐了,返回首页