HTTP -> HTTPS redirection into the Tomcat

  1. Update web.xml configuration file and add the following content into the section:
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Protected Context</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <!-- auth-constraint goes here if you require authentication -->
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

  2. Update server.xml configuration file and add the following content into the section:

    <Valve className="org.apache.catalina.valves.RemoteIpValve"
    remoteIpHeader="x-forwarded-for"
    protocolHeader="x-forwarded-proto"
    protocolHeaderHttpsValue="https" />



  3. Restart Tomcat Node.


Was this article helpful?

mood_bad Dislike 0
mood Like 0
visibility Views: 11929