Apache mod_filter:为什么替换不适用于某些URL?

Apache mod_filter:为什么替换不适用于某些URL?,apache,mod-filter,Apache,Mod Filter,我将mod proxy与mod filter结合使用,以便从网络外部访问内部服务器(nginx)。我的过滤器配置为: SetEnv filter-errordocs # necessary to process requests which don't have HTTP 200 OK FilterDeclare ghe FilterProvider gzinflate INFLATE resp=Content-Encoding $gzip FilterProvider ghe SUBSTITU

我将mod proxy与mod filter结合使用,以便从网络外部访问内部服务器(nginx)。我的过滤器配置为:

SetEnv filter-errordocs # necessary to process requests which don't have HTTP 200 OK
FilterDeclare ghe
FilterProvider gzinflate INFLATE resp=Content-Encoding $gzip
FilterProvider ghe SUBSTITUTE resp=Content-Type $text/
FilterProvider gzdeflate DEFLATE Content-Type $text/
FilterChain +gzinflate +ghe +gzdeflate
FilterTrace ghe 1
这适用于HTML页面,对于
curl-Ihttp://internal/url
提供了如下内容:

HTTP/1.1 200 OK
Server: server.com
Date: Sat, 10 Aug 2013 14:55:25 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Status: 200 OK
Cache-Control: no-cache, no-store
X-Frame-Options: deny
Set-Cookie: logged_in=no; domain=.192.168.120.128; path=/; expires=Wed, 10-Aug-2033 14:55:25 GMT; HttpOnly
Set-Cookie: _fi_sess=xyz HttpOnly
X-Runtime: 19
ETag: "zyx"
Content-Length: 5928
HTTP/1.1 200 OK
Server: server.com
Date: Sat, 10 Aug 2013 14:55:31 GMT
Content-Type: text/css
Content-Length: 269455
Last-Modified: Fri, 09 Aug 2013 14:23:05 GMT
Connection: keep-alive
Accept-Ranges: bytes
但是,当访问
curl-I的css文件时,它不起作用http://internal/url.css
提供了如下内容:

HTTP/1.1 200 OK
Server: server.com
Date: Sat, 10 Aug 2013 14:55:25 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Status: 200 OK
Cache-Control: no-cache, no-store
X-Frame-Options: deny
Set-Cookie: logged_in=no; domain=.192.168.120.128; path=/; expires=Wed, 10-Aug-2033 14:55:25 GMT; HttpOnly
Set-Cookie: _fi_sess=xyz HttpOnly
X-Runtime: 19
ETag: "zyx"
Content-Length: 5928
HTTP/1.1 200 OK
Server: server.com
Date: Sat, 10 Aug 2013 14:55:31 GMT
Content-Type: text/css
Content-Length: 269455
Last-Modified: Fri, 09 Aug 2013 14:23:05 GMT
Connection: keep-alive
Accept-Ranges: bytes
这个问题在Apache的错误日志(带有调试日志级别)中是可见的。对于应用了过滤器的URL,我看到类似的情况(但不确定
EOS
-部分是否是相同的请求):

对于未应用筛选器的URL,我只看到如下内容:

[Sat Aug 10 16:44:27 2013] [debug] mod_headers.c(756): headers: ap_headers_output_filter()
[Sat Aug 10 16:44:27 2013] [debug] mod_filter.c(117): [client 192.168.93.201] ghe
[Sat Aug 10 16:44:27 2013] [debug] mod_filter.c(122): [client 192.168.93.201] ghe: type: EOS, length: 0
所以,只要
EOS
,但没有
HEAP
,如果这意味着什么的话


如何解决这个问题

SUBSTITUTE
过滤器可能无法与
接受范围:字节一起工作。使用mod header并向Apache配置文件添加以下行:

Header set Accept-Ranges "none"
将使过滤器工作