Our company is currently supporting a (very old) web-enabled database application written in 4th Dimension (2003) with a built-in web server (provided by an extension called Web Server 4D). Since the web server has no SSL support, our client set up Apache to handle outside HTTPS connections (via a <VirtualHost>) and route all traffic to the WS4D server over HTTP, using mod_proxy. The routing is working perfectly.
The problem is that the WS4D server often prints out broken URLs when building a page. Since the WS4D server does not know about Apache, whenever it prints out a full URL (domain included), it prints out an internal domain name and port number in a URL instead of the external one (e.g. http://localhost:9999/home instead of https://www.example.com/home). Most of the other links are relative (e.g. /img/smiley.png), and therefore work fine.
To solve this, we tried setting up a third-party Apache module called mod_proxy_html to rewrite the links with the correct domain. However, whenever we just activate the module in httpd.conf (with ProxyHTMLEnable On, but no rewrite rules defined), all of the sudden our PNGs and AJAX requests (which were working previously) fail to load! I'm not sure, but I think the server may be returning these withe the wrong MIME type.
Does anyone know how we could fix/debug this issue?
Update: I checked the links for the PNGs and, since they are relative links (e.g. /img/smiley.png), they are printing out fine. When I put the URL into my browser, however, I get a bunch of gibberish (which I presume is the binary image formatted as text). And, strangely, at the very beginning there are three HTML tags: <html><body><p>.
Update 2: The tags are definitely not being added by my browser (Safari). When I turn off mod_proxy_html, the images load in the page as normal, but still open as text when I visit the URL directly. With mod_proxy_html turned off, the <html><body><p> tags in the image source disappear.
<html><body>prepended to it. Very bizarre...PROXY_HTML_FORCEenv variable set?UnsetEnv PROXY_HTML_FORCEright afterLoadModule proxy_html_module libexec/apache2/mod_proxy_html.soin the Apache config file, but it didn't seem to change anything.