{"id":515,"date":"2018-12-19T08:42:45","date_gmt":"2018-12-19T06:42:45","guid":{"rendered":"https:\/\/blog.chloesoe.ch\/?p=515"},"modified":"2018-12-19T08:45:30","modified_gmt":"2018-12-19T06:45:30","slug":"force-https-in-tomcat","status":"publish","type":"post","link":"https:\/\/blog.chloesoe.ch\/?p=515","title":{"rendered":"Force HTTPS in Tomcat"},"content":{"rendered":"<p>To force every webapp to use https instead of http, add the following part in $TOMCATHOME\/conf\/web. Insert it at the second last line, before end tag <code>&lt;\/web-apps&gt;<\/code><\/p>\n<pre><code>&lt;security-constraint&gt;\r\n    &lt;web-resource-collection&gt;\r\n        &lt;web-resource-name&gt;Entire Application&lt;\/web-resource-name&gt;\r\n        &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt;\r\n    &lt;\/web-resource-collection&gt;\r\n    &lt;user-data-constraint&gt;\r\n        &lt;transport-guarantee&gt;CONFIDENTIAL&lt;\/transport-guarantee&gt;\r\n    &lt;\/user-data-constraint&gt;\r\n&lt;\/security-constraint&gt;\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>To force every webapp to use https instead of http, add the following part in $TOMCATHOME\/conf\/web. Insert it at the second last line, before end tag &lt;\/web-apps&gt; &lt;security-constraint&gt; &lt;web-resource-collection&gt; &lt;web-resource-name&gt;Entire Application&lt;\/web-resource-name&gt; &lt;url-pattern&gt;\/*&lt;\/url-pattern&gt; &lt;\/web-resource-collection&gt; &lt;user-data-constraint&gt; &lt;transport-guarantee&gt;CONFIDENTIAL&lt;\/transport-guarantee&gt; &lt;\/user-data-constraint&gt; &lt;\/security-constraint&gt;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-515","post","type-post","status-publish","format-standard","hentry","category-webserver"],"_links":{"self":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts\/515","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=515"}],"version-history":[{"count":2,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts\/515\/revisions"}],"predecessor-version":[{"id":517,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=\/wp\/v2\/posts\/515\/revisions\/517"}],"wp:attachment":[{"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=515"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=515"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.chloesoe.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=515"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}