How can I conditionally redirect HTTP connections to HTTPS with Tomcat?
I’d like to be able to conditional redirect HTTP connections to HTTPS in Tomcat. Here’s the scenario. -All Internet based traffic should be redirected to HTTPS. -All localhost and local trafic (10.x.x.x, 172.y.x.x, 192.168.x.x) should NOT be redirected; talking HTTP is fine. Regular Apache will let me do this because the URL rewriting logic can look at the interface the traffic comes in on. I can send all traffic that comes in on the public facing IP address to HTTPS and leave the rest alone. How can I accomplish the same thing with Tomcat?