0

I have a virtual machine with Ubuntu server 18.04 on which I am running an apache2 webserver with two virtual hosts. I configured one vhost to run as a reverse proxy for the other vhost. On the proxy I use the substitute_module to change some of the proxied content (text/html). As an easy start I want to slightly change the "Apache2 Default Ubuntu Page" (index.html) by exchanging the headline with "Substitute works!".

When I hit a curl on that site and check the html code, the headline was changed. But when I load the page with any browser (Firefox/Chrome/IE), the document remains unchanged from the original one. What I did so far:

  • empty the cache; using the network analysis tool of the browser says, that it didn't receive the content from cache

  • check the server logs-> I get the same notifications there as when I access the document with curl e.g.:

[Fri Mar 13 18:09:43.093779 2020] [proxy:debug] [pid 3223:tid 139804452681472] proxy_util.c(2192): AH00943: http: has released connection for (127.0.0.1)
[Fri Mar 13 18:09:43.093940 2020] [filter:trace4] [pid 3223:tid 139804452681472] mod_filter.c(169): [client 10.0.2.2:50431] Content-Type 'text/html' ...
[Fri Mar 13 18:09:43.094262 2020] [filter:trace4] [pid 3223:tid 139804452681472] mod_filter.c(175): [client 10.0.2.2:50431] ... matched 'text/html'
[Fri Mar 13 18:09:43.094348 2020] [filter:trace2] [pid 3223:tid 139804452681472] mod_filter.c(188): [client 10.0.2.2:50431] Content-Type condition for 'substitute' matched

This is the interesting extract of the curl output:

      <div class="page_header floating_element">
        <img src="/icons/ubuntu-logo.png" alt="Ubuntu Logo" class="floating_element"/>
        <span class="floating_element">
          Substitute works!
        </span>
      </div>

This is the copied snippet from the html laoded by the browser:

<div class="page_header floating_element">
        <img src="/icons/ubuntu-logo.png" alt="Ubuntu Logo" class="floating_element">
        <span class="floating_element">
          Apache2 Ubuntu Default Page
        </span>
      </div>

I suspect it might be some browser optimization that detects the manipulation and somehow reverses it? But I'm not too familiar with this topic, so I would be really happy about any explanations/hints where to search.

If any configuration details would be useful, I will gladly provide those.

Marten
  • 1

0 Answers0