Apache, mod_proxy_ajp, Tomcat, SSLpache, mod_proxy_ajp, Tomcat, SSL
Just because I had to fight with it today and did not find the solution spelled out elsewhere (I found all parts, but not the definitive answer):
If you have an apache server that uses modproxyajp to proxy requests to tomcat and you want to use https as schema, even when you do redirects, you have to massage the ajp connector settings of tomcats server.xml.
Only when you add the following attributes to the connector, a redirect (for example a Spring RedirectView) will stay in https and not jump to http:
- scheme=”https”
- secure=”true”
- proxyPort=”443”
The scure attribute might not really be necessary, but it did no harm.
This is actually from Robin Johnson, but he did not mention the connector it has to be on.
If you think about it, it’s clear that it has to be the ajp connector, since apache is using that one to talk to tomcat.
Well, took me some nerves to get this into production today, so I thought I mention it, maybe it will help someone else. For me, I hope I won’t have to deal with tomact and jsp anymore…
Wed, 30 Jan 2008 09:31 Posted in Programming
5 comments »
-
By proxy sites 24/11/2009 at 12h50
-
By Underground Guitarist 30/05/2010 at 23h18
Well, took me some nerves to get this into production today, so I thought I mention it, maybe it will help someone else. For me, I hope I won’t have to deal with tomact and jsp anymore…
-
By software for construction 31/07/2010 at 16h04
It’s usually hard to make a complicated matter seem very easy.
-
By internet marketing chicago 20/10/2010 at 07h04
I do have an Apache server at our office and your tip will come in really handy. Thanks mate.
-
By Beats Headphones 22/11/2010 at 00h45
Thank you, teacher. You are the best!!

Going to play with it, right away. Will post updates. Cool bit.