rdasxy
rdasxy

Reputation: 1661

HTTPS issue with TOMCAT running behind Apache

I have a Tomcat app running behind Apache.

Apache is configured for HTTPS while Tomcat still uses HTTP. This means that whenever the user loads a webpage (served by Tomcat via Apache), they see a "mixed content" warning in some browsers.

Also, JSP redirects are not working either.

What's the best way to resolve this? Should I enable HTTPS for Tomcat?

Upvotes: 1

Views: 2670

Answers (2)

BalusC
BalusC

Reputation: 1108632

they see a "mixed content" warning in some browsers

This will only happen when the HTML response of a HTTPS request references other resources like images, CSS and JS files over HTTP instead of HTTPS. You need to fix the resource URLs to be HTTPS as well. Or, if the page can be served over both HTTP and HTTPS, then you need to make the resource URLs scheme-relative, like so:

<link rel="stylesheet" href="//example.com/css/style.css" />
<script src="//example.com/js/script.js"></script>
<img src="//example.com/images/logo.png" />

Also, JSP redirects are not working either.

The phrase "not working" is too broad in order to be able to give an answer/solution to that.

Upvotes: 2

Kaleb Brasee
Kaleb Brasee

Reputation: 51925

That's what I did, set up both an ajp13secured and ajp13unsecured worker on Tomcat, then JkMounted them in the Apache config to route port 443 to ajp13secured and port 80 to ajp13unsecured.

It was a while ago, but I believe this is the page I followed to set up that configuration: http://ask.metafilter.com/53101/How-do-I-force-HTTPS-in-Tomcat-through-Apache-and-modjk

Upvotes: 0

Related Questions