Apache and Tomcat not recognizing SSL correctly

Akitogo Team, 23 Oct 2019

This is a quick technical note how to pass cgi SSL status from Apache to Tomcat when using mod_proxy. We recently had a Coldbox Application which was generating http links instead of https using event.buildLink() while the site had SSL enabled. It turned out that we had to add the following line:
<ifmodule mod_proxy.c="">
ProxyPreserveHost On

RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}
ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$$1$2
ProxyPassMatch ^/(.+\.cfml)(/.*)?$$1$2