Apache 2.4:ProxyErrorOverride使404请求非常慢

时间:2014-02-26 13:52:40

标签: apache

我的配置:

<VirtualHost *:80>
  ServerAlias local.test

  CustomLog   /var/log/apache2/custom.access cg-common
  ErrorLog    /var/log/apache2/custom.error

  RewriteEngine   On

  <Location /p-500x500/>
      ErrorDocument 404 /p-500x500/noimg.png
  </Location>

  ProxyPreserveHost On
  ProxyErrorOverride On
  ProxyPass / http://localhost:8080/
  ProxyPassReverse / http://localhost:8080/
</VirtualHost>

每当我请求存在的图像时,请求都非常快。但是,当我请求某些内容时,不存在,我会延迟最多20秒,直到正确提供noimg.png为止。

我用LogLevel trace6查看了错误日志,注意到这些行之间有很长的延迟:


[Wed Feb 26 15:42:36.887370 2014] [core:trace6] [pid 3585:tid 4475531264] core_filters.c(525): [remote 172.19.30.253:8098] core_output_filter: flushing because of FLUSH bucket
[Wed Feb 26 15:42:36.945750 2014] [proxy_http:trace3] [pid 3585:tid 4475531264] mod_proxy_http.c(1402): [client ::1:54550] Status from backend: 404
[Wed Feb 26 15:42:36.945785 2014] [proxy_http:trace4] [pid 3585:tid 4475531264] mod_proxy_http.c(1085): [client ::1:54550] Headers received from backend:
[Wed Feb 26 15:42:36.945805 2014] [proxy_http:trace4] [pid 3585:tid 4475531264] mod_proxy_http.c(1088): [client ::1:54550] Server: MochiWeb/1.1 WebMachine/1.10.5 (jokes are better explained)
[Wed Feb 26 15:42:36.945816 2014] [proxy_http:trace4] [pid 3585:tid 4475531264] mod_proxy_http.c(1088): [client ::1:54550] Date: Wed, 26 Feb 2014 13:42:36 GMT
[Wed Feb 26 15:42:36.945825 2014] [proxy_http:trace4] [pid 3585:tid 4475531264] mod_proxy_http.c(1088): [client ::1:54550] Content-Type: text/plain
[Wed Feb 26 15:42:36.945832 2014] [proxy_http:trace4] [pid 3585:tid 4475531264] mod_proxy_http.c(1088): [client ::1:54550] Content-Length: 10

并在12秒后:


[Wed Feb 26 15:42:48.159840 2014] [proxy:debug] [pid 3585:tid 4475531264] proxy_util.c(2033): AH00943: HTTP: has released connection for (localhost)

1 个答案:

答案 0 :(得分:2)

刚刚遇到同样的事情,经过一段时间的搜索终于找到了帮助我解决问题的页面。

似乎是Apache 2.4中的一个错误: https://issues.apache.org/bugzilla/show_bug.cgi?id=53420