页面树结构

版本比较

标识

  • 该行被添加。
  • 该行被删除。
  • 格式已经改变。


目录

配置tomcat文件(web.xml)

进入tomcat的配置目录下(%tomcatHome%\conf)修改web.xml文件中的 web-app 节点下 添加以下配置。

代码块
linenumberstrue
    <!-- http 强制转 https 配置 -->
    <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>
    
    <!-- 禁用没必要的 http 请求类型 配置 -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>filter-http-method</web-resource-name>
            <url-pattern>/*</url-pattern>
            <http-method>OPTIONS</http-method>
            <http-method>PUT</http-method>
            <http-method>DELETE</http-method>
            <http-method>OPTIONS</http-method>
            <http-method>HEAD</http-method>
        </web-resource-collection>
        <auth-constraint></auth-constraint>
    </security-constraint>