Apache mod_proxy_html and brotli compression

256 views Asked by At

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.

0

There are 0 answers