1. 程式人生 > >Tomcat配置部分頁面Https訪問

Tomcat配置部分頁面Https訪問

Tomcat配置部分頁面Https訪問

1、首先對Tomcat進行認證配置(參見:https單向/雙向認證的tomcat配置攻略

http://xiaohuafyle.iteye.com/blog/1538719


2、修改tomcat下的conf的web.xml檔案,在</web-app>前面增加要https訪問的路徑的配置。如:(下面代表以 /mm/或/fi/開頭的路徑系統將自動轉為https)

<security-constraint>
<web-resource-collection>
<web-resource-name>must https</web-resource-name>
<url-pattern>/mm/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>must https</web-resource-name>
<url-pattern>/fi/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

1、首先對Tomcat進行認證配置(參見:https單向/雙向認證的tomcat配置攻略

http://xiaohuafyle.iteye.com/blog/1538719


2、修改tomcat下的conf的web.xml檔案,在</web-app>前面增加要https訪問的路徑的配置。如:(下面代表以 /mm/或/fi/開頭的路徑系統將自動轉為https)

<security-constraint>
<web-resource-collection>
<web-resource-name>must https</web-resource-name>
<url-pattern>/mm/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>must https</web-resource-name>
<url-pattern>/fi/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>