在tomcat中設定http自動跳轉https
阿新 • • 發佈:2018-11-09
相關文章:
在CentOS 1804 中的 Tomcat 9 設定 SSL( https ) 加密 (多域名加密,阿里雲 SSL+ 騰訊雲 SSL)
在CentOS 1804 中設定 Apache Tomcat 9.0.12 開機自啟
- server.xml設定:
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="443" />
- web.xml設定(在最後):
由於內容較多,建議使用FlashFXP下載修改後,再上傳覆蓋。<login-config> <auth-method>CLIENT-CERT</auth-method> <realm-name>Client Cert Users-only Area</realm-name> </login-config> <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>
重啟Tomcat測試。
相關文章:
在CentOS 1804 中的 Tomcat 9 設定 SSL( https ) 加密 (多域名加密,阿里雲 SSL+ 騰訊雲 SSL)