Tomcat配置SSL後使用HTTP後跳轉到HTTPS

Tomcat配置好SSL後將HTTP請求自動轉到HTTPS須要在TOMCAT/conf/web.xml的未尾加入如下配置:html

<login-config>  
    <!-- Authorization setting for SSL -->  
    <auth-method>CLIENT-CERT</auth-method>  
    <realm-name>Client Cert Users-only Area</realm-name>  
</login-config>  
<security-constraint>  
    <!-- Authorization setting for SSL -->  
    <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配置參考百度雲服務器部署免費的SSL證書(TOMCAT) : https://jingyan.baidu.com/article/73c3ce285aff25e50343d9eb.html
相關文章
相關標籤/搜索