I'm experimenting with apache mod_include.
I got two servers running apache: I'm trying to include in my test_local.shtml (server1) some simple text from test_remote.shml (server2).
test_local.shtml:
<html>
<head>
<title></title>
</head>
<body>
<!--#include virtual="http://www.server2.com/test_remote.shtml"-->
</body>
</html>
test_remote.shtml:
<b>this is a test</b>
At first it didn't work (got "File does not exist" error in error_log). It looks like that for security reasons the only files I manage to include are on my local server (server1), with a local path, but not a remote url. Then I understood that I needed to use mod_proxy (and mod_proxy_html) in combination with mod_include to make remote inclusion work.
So I added the following to my httpd.conf (on server1):
ProxyPass /server2 http://www.server2.com
Then I changed the include line in test_local.shtml to:
<!--#include virtual="/server2/test_remote.shtml"-->
No errors this time, something gets included, but the resulting text is all garbled:
‹³I²+ÉÈ,V¢D…’Ôâý$;.j¿è
Am I missing something in my configuration? What's wrong?
UPDATE: I suspect it's something about the way data is sent (and then read) between the two servers.. such as compression or similar. I checked mod_deflate configuration section, which is included and working in both servers, and it's the same. Any idea? Thanks
UPDATE 2: disabling SetOutputFilter DEFLATE on server2, the text included with mod_include on server1 is perfectly readable. So that's the source of the issue: how can I configure server1 to handle the gzipped content and display it correctly? (Hypotetically I'd imagine some sort of inputfilter opposed to outputfilter..)