{"id":634,"date":"2015-05-20T21:11:07","date_gmt":"2015-05-20T21:11:07","guid":{"rendered":"http:\/\/192.168.1.102\/?p=634"},"modified":"2015-05-20T21:24:13","modified_gmt":"2015-05-20T21:24:13","slug":"tomcat-8-redirect-and-force-ssl","status":"publish","type":"post","link":"https:\/\/digitalsos.net\/?p=634","title":{"rendered":"Tomcat 8 redirect and force SSL"},"content":{"rendered":"<p>Edit the tomcat8\/conf\/server.xml and add the following for 80, and another for 8080 if need be.<\/p>\n<p>&lt;Connector port=&#8221;80&#8243; protocol=&#8221;HTTP\/1.1&#8243;<br \/>\nconnectionTimeout=&#8221;20000&#8243;<br \/>\nURIEncoding=&#8221;UTF-8&#8243;<br \/>\nenableLookups=&#8221;false&#8221;<br \/>\nredirectPort=&#8221;443&#8243; \/&gt;<\/p>\n<p>Now Edit the tomcat8\/conf\/web.xml and at the bottom just above &lt;\/web-app&gt; put in the following and changing Entire Application to your application in webapps.<\/p>\n<p>&lt;!&#8211; SSL settings. only allow HTTPS access to MY APPLICATION &#8211;&gt;<br \/>\n&lt;security-constraint&gt;<br \/>\n&lt;web-resource-collection&gt;<br \/>\n&lt;web-resource-name&gt;Entire Application&lt;\/web-resource-name&gt;<br \/>\n&lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;<br \/>\n&lt;\/web-resource-collection&gt;<br \/>\n&lt;!&#8211; auth-constraint goes here if you requre authentication &#8211;&gt;<br \/>\n&lt;user-data-constraint&gt;<br \/>\n&lt;transport-guarantee&gt;CONFIDENTIAL&lt;\/transport-guarantee&gt;<br \/>\n&lt;\/user-data-constraint&gt;<br \/>\n&lt;\/security-constraint&gt;<\/p>\n<p>Now restart the tomcat service.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Edit the tomcat8\/conf\/server.xml and add the following for 80, and another for 8080 if need be. &lt;Connector port=&#8221;80&#8243; protocol=&#8221;HTTP\/1.1&#8243; connectionTimeout=&#8221;20000&#8243; URIEncoding=&#8221;UTF-8&#8243; enableLookups=&#8221;false&#8221; redirectPort=&#8221;443&#8243; \/&gt; Now Edit the tomcat8\/conf\/web.xml and at the bottom just above &lt;\/web-app&gt; put in the following and changing Entire Application to your application in webapps. &lt;!&#8211; SSL settings. only allow HTTPS access<\/p>\n<div class=\"read-more-wrapper\"><a class=\"read-more\" href=\"https:\/\/digitalsos.net\/?p=634\" title=\"Read More\"> <span class=\"button \">Read More<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[19],"tags":[32,31],"class_list":["post-634","post","type-post","status-publish","format-standard","hentry","category-linux","tag-ssl","tag-tomcat"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pgxmGV-ae","_links":{"self":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts\/634","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=634"}],"version-history":[{"count":6,"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/digitalsos.net\/index.php?rest_route=\/wp\/v2\/posts\/634\/revisions\/636"}],"wp:attachment":[{"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=634"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digitalsos.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}