Tomcat配置部分页面Https访问

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xll_csdn/article/details/78211656
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>

猜你喜欢

转载自blog.csdn.net/xll_csdn/article/details/78211656