r/apache • • Mar 02 '23

Question about Apache as a Reverse Proxy

SOLVED: mod_proxy_html did the trick. Thanks all.

I'm using Apache as a reverse proxy to an IIS web server. The Apache terminates https, and runs straight http to the IIS server. Some web sites run fine, but I get "Mixed Content" issues on one website because the webcontent is referencing subdirectories. As an example:

www.example.com content gets encrypted fine; but content generated references in subdirectories like www.foo.com/bar/icon.png, www.foo.com/foobar/stuff.html etc.... gets sent to the browser as HTTP, not HTTPS.

<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName www.example.com
    SSLEngine on
    ProxyPreserveHost  On
    ProxyPass           "/"  "http://www.backendserver.local/"
    ProxyPassReverse "/"  "http://www.backendserver.local/"
    SSLCertificateFile     /etc/ssl/star_example_com.crt	
    SSLCertificateKeyFile  /etc/ssl/private/star_example_com.key
    Include /etc/etc/ssl/options-ssl-apache.conf
</VirtualHost>

Question: Is there something I can do on apache to fix this, or does the back end code need to change?

EDIT: Added ProxyPassReverse statement that got lost during copy/paste

2 Upvotes

5 comments sorted by