1

I'm using mod_proxy_html in a Reverse Proxying scenario. It has served me well for years.

Now that the backend apparently has started to support Brotli compression it no longer works.

My config looks like this:

<VirtualHost *:443>
  ServerName www.mysite.com

  ProxyRequests Off
  ProxyPreserveHost On
  ProxyVia full
  ProxyPass "/" "http://target-site.com/"
  ProxyPassReverse "/" "http://target-site.com/"


  # **********************************************************
  # Use mod_proxy_html to rewrite URLs inside the html.
  #
  # **********************************************************


  # Make sure that the filter works on deflated input, otherwise we'll
  # get a blank page.
  SetOutputFilter DEFLATE;proxy-html;INFLATE
  ProxyHTMLEnable On
  ProxyHTMLLinks  a          href
  # Lots of 'ProxyHTML*' directives here
  ...
</VirtualHost>

The interesting part is the SetOutputFilter directive. It needs to be there - I've been told - to make sure that mod_proxy_html operates on plain-text content, not compressed content.

My question is what to set it to when I don't really know (or care) which form of compression is used. I suppose DEFLATE / INFLATE refer to a specific method of compression, right? All I want is to make sure that the mod_proxy_html works on content which is plain text. I suppose it has been working fine all these years because I've simply been lucky that deflate was indeed the algorithm being used for compression.

I can currently only access my site via curl as luckily curl does not send Accept-Encoding: gzip, deflate, br request header as do browsers.

peterh
  • 18,404
  • 12
  • 87
  • 115
  • Hmm. It doesn't seem there are any real good solutions if one wants to keep the possibility for compression when content is fetched from the backend. I've found this rather old [article](http://www.apachetutor.org/admin/reverseproxies) (see section "Dealing with multimedia content") about the mod_proxy_html module. – peterh Mar 26 '22 at 14:29
  • This is the exact same issue that I am facing. I tried using BROTLI_COMPRESS but I guess that is a totally different meaning and did not help me. And you are right INFLATE and DEFLATE work with only gzip type of encoding in my experience and does not work with br (brotli) type of encoding. I see you posted a comment to your question too, I read it but could not make anything of it. Does that page has any solution for the problem we are facing. Also were you able to figure out any solution for this problem. – datastax Feb 09 '23 at 17:26
  • @datastax. No, I did not find a solution. – peterh Feb 11 '23 at 08:53

0 Answers0