Tomcat设置http跳转https

suaxi
2020-06-01 / 0 评论 / 66 阅读 / 正在检测是否收录...

以Tomcat 9.0.27为例
在conf/web.xml末尾添加以下内容即可:

<security-constraint>
    <web-resource-collection>
        <web-resource-name>SSL</web-resource-name>
        <url-pattern>/*</url-pattern>
    </web-resource-collection>

    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
</security-constraint>

SSL.png

0

评论 (0)

取消