httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ray Van Dolson <>
Subject [users@httpd] mod_filter newbie
Date Mon, 29 Jun 2009 22:11:21 GMT
Hi all, I'm trying to replace some of my legacy AddOutputFilterByType
configuration directives with the more flexible dynamic syntax.

I have a reverse proxy set up in front of a server that is likely to
provide gzip compressed data.

I need to use mod_substitute to do a search and replace on the
text/html files however, so I have to ensure that I do not have a
gzip'd stream (mod_substitute can't handle this).


  RequestHeader unset Accept-Encoding
  AddOutputFilterByType SUBSTITUTE text/html
  Substitute "s|wrongtext|rightext|n"

  <Location />
    Proxy Pass ...
    ProxyPassReverse ...


  FilterProvider gzinflate INFLATE resp=Content-Encoding $gzip
  FilterProvider replace SUBSTITUTE Content-Type $text/
  FilterProvider gzdeflate DEFLATE Content-Type $text/
  # I believe the + is not needed in my case..
  FilterChain +gzinflate +replace +gzdeflate
  Substitute "s|wrongtext|rightext|n"

  <Location />
    Proxy Pass ...
    ProxyPassReverse ...

Both blocks work, but I'm thinking I could potentially end up calling
gzdeflate on data that wasn't originally compressed.  Maybe someone can

  - Does each member of a FilterChain get called regardless?  For

      text/html (uncompressed) doesn't match on the gzinflate line, but
      would one he next two.  I'd end up with compressed output that
      wasn't originally compressed.

  - If so, should I set an environment variable if Content-Encoding =
    gzip and then have my gzdeflate provider check for it instead of
    operating blindly on all text/* ?

    Or maybe some way to check if the request we're responding to had
    Accept-Encoding gzip set?


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message