I have two web sites that produce data that I would like to combine into one web page. Site one (the "main" site) produces most of the web page, and site two contains additional data that I want to include on that page. I figure the best way would be to use SSI to include data from site two into the web page produced by site one. Apache on site one seems to contact site two properly, but site two returns a 404. If I contact site two directly with a browser, using the exact same URL that site one is using, I get proper data. Why wouldn't Apache on site one get the same data?
I've tried two ways to include the data from site two, one directly and one using a reverse proxy, but neither works. Other (local) SSIs and reverse-proxies work fine on this page. These are the two include lines:
<!--#include virtual="/servertwodata" -->
<!--#include virtual="http://www.servertwo.com/execs/somescript.sh?task=overview" -->
The error that I get in the Apache error log is:
unable to include "http://www.servertwo.com/execs/somescript.sh?task=overview" in parsed file /var/www/html/index.html, subrequest returned 404, referer: http://www.serverone.com/index.html
Does anyone have a clue why Apache on site one would get a 404 from site two, but the exact same URL in a generic browser would get the data fine?
It turns out that reverse proxy does discards any query string that is included as part of the proxypass configuration parameter. I removed the query string from the proxypass parameter and moved it to the SSI include virtual tag, and it no longer gets the 404 from site two. The response that is put on the web page is scrambled hieroglyphics, but what's causing that is a different question.