0

I am trying to put an old Tomcat behind an Apache HTTPS reverse proxy. I configured the https virtual host to perform the actual proxying and the http virtual host to redirect everything to https:

https snippet:

ProxyRequests Off ProxyPass /old_app/ http://192.168.1.18:8080/old_app/ ProxyPassReverse /old_app/ http://192.168.1.18:8080/old_app/ 

http snippet:

RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] 

The problem is that the website shows up, but there are no CSS or images. If inspect using Chrome Developer Console I see a lot of errors regarding mixed content, that are blocked because originally referred in http. I searched around and I found some suggestions regarding modifying the proxied website, but in my situation I can not modify the Tomcat webapp. Is there a way to solve this problem? Or the only way is modify old_app source code? Maybe switching to Nginx with some particular configurations?

1 Answer 1

0

Rewrite HTML so you can change the scheme from HTTP to HTTPS

You are looking for mod_proxy_html

The proxy itself has no way to rewrite the HTML that contains scheme, domain, or url. This module allows you to rewrite these on the fly.

1
  • Thanks for the suggestion, but I had no luck...I added ProxyHTMLEnable On SetOutputFilter proxy-html ProxyHTMLExtended On ProxyHTMLURLMap http://example.com https://example.com But I still receive errors like: The page at https://example.com/old_app/jsp/index.jsp was loaded over HTTPS, but requested an insecure stylesheet http://example.com/old_app/css/jquery.autocomplete.css. This request has been blocked; the content must be served over HTTPS. Commented Feb 26, 2017 at 19:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.