zoukankan      html  css  js  c++  java
  • IIS隐藏响应头信息

    修改Server

    # 先安装url-rewrite组件
    http://www.iis.net/downloads/microsoft/url-rewrite
    
    # 修改应用根目录下的Web.config配置文件
    <configuration>
    ...
      <system.webServer>
      ...
            <httpProtocol>
                <customHeaders>
                    <remove name="X-Powered-By" />
                </customHeaders>
            </httpProtocol>
    		<rewrite>    
    		  <outboundRules rewriteBeforeCache="true">
    			<rule name="Remove Server header">
    			  <match serverVariable="RESPONSE_Server" pattern=".+" />
    			  <action type="Rewrite" value="Apache" />
    			</rule>
    		  </outboundRules>
    		</rewrite>
      </system.webServer>
    </configuration>

    隐藏X-AspNet-Version

    <configuration>
    ...
      <system.web>
        <compilation targetFramework="4.6.1" />
    	<httpRuntime enableVersionHeader="false" />
        <!--httpRuntime targetFramework="4.6.1" maxRequestLength="40960" /-->
      </system.web>
    </configuration>

    删除X-AspNetMvc-Version

    在Global.asax的Application_Start事件中将MvcHandler类的DisableMvcResponseHeader属性设置为True
    MvcHandler.DisableMvcResponseHeader = True

    删除X-Powered-By

    IIS8中移除X-Powered-By HTTP头的步骤:

      1 打开IIS管理器
      2 展开 网站 选择对应的项目并双击 HTTP响应标头
      3 删除相应的头信息

    本文来自博客园,作者:MegaloBox,转载请注明原文链接:https://www.cnblogs.com/cpw6/p/15767703.html

  • 相关阅读:
    A physically based scene with three.js
    pbr-guide
    Art Pipeline for glTF
    GG5D
    Leetcode 146.LRU缓存机制
    Leetcode 143.重排链表
    Leetcode 142.环形链表II
    Leetcode 141.环形链表
    Leetcode 139.单词拆分
    Leetcode 138.复制带随机指针的链表
  • 原文地址:https://www.cnblogs.com/cpw6/p/15767703.html
Copyright © 2011-2022 走看看