页面树结构
转至元数据结尾
转至元数据起始

正在查看旧版本。 查看 当前版本.

与当前比较 查看页面历史

版本 1 下一个 »


配置tomcat文件(web.xml)

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

    <!-- 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>
  • 无标签