May 20

Tomcat 8 redirect and force SSL

Edit the tomcat8/conf/server.xml and add the following for 80, and another for 8080 if need be.

<Connector port=”80″ protocol=”HTTP/1.1″
redirectPort=”443″ />

Now Edit the tomcat8/conf/web.xml and at the bottom just above </web-app> put in the following and changing Entire Application to your application in webapps.

<!– SSL settings. only allow HTTPS access to MY APPLICATION –>
<web-resource-name>Entire Application</web-resource-name>
<!– auth-constraint goes here if you requre authentication –>

Now restart the tomcat service.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Close Bitnami banner