无法加载资源:净:: ERR_CONNECTION_RESET与Apache 2.4和Chrome [英] Failed to load resource: net::ERR_CONNECTION_RESET with Apache 2.4 and Chrome
问题描述
我使用的应用程序背后使用Apache 2.4反向代理(的mod_jk )。
当我要求的一些页面,它将永远载入,并且不会最终加载。
经过调查,我发现时,直接访问的缺席一些微妙的JavaScript错误(无反向代理)。
进一步钻研,它变成了一个特定的的.js 的文件将无法完成加载,我得到一个客户端错误: ERR_CONNECTION_RESET 有部分加载的的.js 的文件。
我注意到的Apache2和Tomcat都顺利地工作在一起,这是不是的Apache2和Jetty 7.3。
的情况下,PS:只有当外部静态IP地址都参与会出现此错误
。这感觉就像是有什么地方超时
日志下面都涉及到一个单一的的.js 的唯一资源请求(引起的主要问题之一)。
的access.log:
客户端的IP地址 - - [13/1月/ 2016:15:35:14 +0000]GET /mifos/webcontent/birt/ajax/lib/prototype.js HTTP / 1.1200 47603
error.log中(是 LogLevel的调试和 ProxyHTMLLogVerbose打开)
[周三15年1月13日:35:14.688949 2016年] [authz_core:调试] [PID 31137:TID 3011484480] mod_authz_core.c(835):客户端IP地址的: 53033] AH01628:授权结果:授予(无指令)
[周三15年1月13日:35:14.689058 2016年] [代理:调试] [PID 31137:TID 3011484480] mod_proxy.c(1163):客户端IP地址的:53033] AH01143:运行计划http处理程序(尝试0)
[周三15年1月13日:35:14.689071 2016年] [proxy_ajp:调试] [PID 31137:TID 3011484480] mod_proxy_ajp.c(710):客户端IP地址的:53033] AH00894:下降URL为http://服务器 - 本地IP地址:8080 / mifos /的WebContent / BIRT / AJAX / lib中/的prototype.js
[周三15年1月13日:35:14.689083 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2140):AH00942:HTTP:已取得连接(服务器本地IP地址)
[周三15年1月13日:35:14.689093 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2193):客户端IP地址的:53033] AH00944:连接HTTP://服务器本地-ip地址:8080 / mifos /的WebContent / BIRT / AJAX / lib中/的prototype.js到服务器的本地IP地址:8080
[周三15年1月13日:35:14.689104 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2394):客户端IP地址的:53033] AH00947:连接/ mifos /的WebContent / BIRT / AJAX / lib中/的prototype.js到服务器的本地IP地址:8080
[周三15年1月13日:35:14.689158 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2636):AH00951:HTTP:后端插座断开。
[周三15年1月13日:35:14.689590 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2771):AH02824:HTTP:连接与服务器的本地IP地址的建立:8080(服务器本地-IP地址)
[周三15年1月13日:35:14.689628 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2923):AH00962:HTTP:连接完成到服务器的本地IP地址:8080(服务器本地-IP地址)
[周三15年1月13日:35:15.141686 2016年] [代理:调试] [PID 31137:TID 3011484480] proxy_util.c(2155):AH00943:HTTP:已发布的连接(服务器本地IP地址)
MOD-jk.log (无除了一个反复一行有趣的):
[星期三1月13日15时03分22秒2016年] [30041:3075380928] [资讯] init_jk :: mod_jk.c(3383):MOD_JK / 1.2.40初始化
我终于解决了这个问题。
突破发生时,我跟着@约翰ktejik的指令:
<一个href=\"http://stackoverflow.com/questions/4390134/failed-to-load-resource-under-chrome/26742627\">Failed在Chrome浏览器加载资源
我才明白,所涉及的资源是一个.jar文件内。因此,我不得不告诉的Apache2要明确地使用 SetOutputFilter膨胀;代理HTML; DEFLATE
这时候,我开始做一些进展。
由于充气/放气指令禁用一些链接,我不得不做出它独家的JavaScript文件:
AddOutputFilterByType DEFLATE应用程序/ x-的JavaScript
另外,我需要一个额外的好办法是启动 指定mod_expires 的和 mod_headers中的(适用的来源)。
最后,我想在不同的机器上测试之前,而清除高速缓存。
显然,问题与缓存过期和静态IP,我不能真正理解。
更重要的是,这个问题就解决了(在与静态和动态IP不同的浏览器不同的机器测试)!
I use an application behind a reverse proxy using Apache 2.4 (mod_jk).
When I request some page, it takes forever to load, and won't eventually load at all.
After investigation, I discovered some subtle JavaScript errors that are absent when accessed directly (no reverse proxy).
Delving further, it turned out that a specific .js file wouldn't complete loading, and I get a client side error: ERR_CONNECTION_RESET with a partially loaded .js file.
I noticed that Apache2 and Tomcat both work smoothly together, which is not the case between Apache2 and Jetty 7.3.
PS: This error occurs only when external static IP addresses are involved.
It feels like there is a timeout somewhere.
The logs below are related to a single .js resource request only (the one that causes the major problem).
access.log:
client-ip-address - - [13/Jan/2016:15:35:14 +0000] "GET /mifos/webcontent/birt/ajax/lib/prototype.js HTTP/1.1" 200 47603
error.log (with LogLevel debug and ProxyHTMLLogVerbose On):
[Wed Jan 13 15:35:14.688949 2016] [authz_core:debug] [pid 31137:tid 3011484480] mod_authz_core.c(835): [client client-ip-address:53033] AH01628: authorization result: granted (no directives)
[Wed Jan 13 15:35:14.689058 2016] [proxy:debug] [pid 31137:tid 3011484480] mod_proxy.c(1163): [client client-ip-address:53033] AH01143: Running scheme http handler (attempt 0)
[Wed Jan 13 15:35:14.689071 2016] [proxy_ajp:debug] [pid 31137:tid 3011484480] mod_proxy_ajp.c(710): [client client-ip-address:53033] AH00894: declining URL http://server-local-ip-address:8080/mifos/webcontent/birt/ajax/lib/prototype.js
[Wed Jan 13 15:35:14.689083 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2140): AH00942: HTTP: has acquired connection for (server-local-ip-address)
[Wed Jan 13 15:35:14.689093 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2193): [client client-ip-address:53033] AH00944: connecting http://server-local-ip-address:8080/mifos/webcontent/birt/ajax/lib/prototype.js to server-local-ip-address:8080
[Wed Jan 13 15:35:14.689104 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2394): [client client-ip-address:53033] AH00947: connected /mifos/webcontent/birt/ajax/lib/prototype.js to server-local-ip-address:8080
[Wed Jan 13 15:35:14.689158 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2636): AH00951: HTTP: backend socket is disconnected.
[Wed Jan 13 15:35:14.689590 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2771): AH02824: HTTP: connection established with server-local-ip-address:8080 (server-local-ip-address)
[Wed Jan 13 15:35:14.689628 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2923): AH00962: HTTP: connection complete to server-local-ip-address:8080 (server-local-ip-address)
[Wed Jan 13 15:35:15.141686 2016] [proxy:debug] [pid 31137:tid 3011484480] proxy_util.c(2155): AH00943: http: has released connection for (server-local-ip-address)
mod-jk.log (nothing interesting except one repeated line ):
[Wed Jan 13 15:03:22 2016][30041:3075380928] [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
I've finally solved the issue.
The breakthrough occured when I followed @john ktejik's directives:
Failed to load resource under Chrome
I came to realize that the involved resource was encompassed within a .jar file. Therefore, I had to tell Apache2 to explicitely use "SetOutputFilter INFLATE;proxy-html;DEFLATE".
That's when I started to make some progress.
Since The inflate/deflate directive disables some links, I had to make it exclusive for javascript files:
"AddOutputFilterByType DEFLATE application/x-javascript".
Also, I needed an extra tweak which is to activate mod_expires and mod_headers (source).
Finally, I would rather clear cache before testing in different machines.
Clearly, the problem is related to Cache expiration and Static IP, which I can't really understand.
More importantly, the problem is solved (tested on different machines with different browsers with static and dynamic IP)!
这篇关于无法加载资源:净:: ERR_CONNECTION_RESET与Apache 2.4和Chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!