移除php响应头server,移除不必要的Http响应头(Server 、X-Powered-By、X-AspNet-Version)...

本文旨在讨论如何从HTTP响应中删除不必要的头部信息,如Server(服务器版本)、X-Powered-By(网站由ASP.NET驱动)和X-AspNet-Version(使用的ASP.NET版本)。提供了通过注册表、URLScan工具和URLRewrite模块等三种方法进行移除,并强调了在某些情况下可能需要保留这些头部信息。
摘要由CSDN通过智能技术生成

Remove Unwanted HTTP Response Headers

he purpose of this blog post is to discuss how to remove unwanted HTTP response headers from the response. Typically we have 3 response headers which many people want to remove for security reason.

Server- Specifies web server version.

X-Powered-By- Indicates that the website is "powered by ASP.NET."

X-AspNet-Version- Specifies the version of ASP.NET used.

Before you go any further, you should evaluate whether or not you need to remove these headers. If you have decided to remove these headers because of a security scan on your site, you may want to read the following blog post by David Wang.

If you would like to go ahead and remove the headers then follow the following options.

ServerHeader

There are three ways to remove the Server header from the response. The best one is to use the third option.

1.Using the Registry key.

Create a DWORD entry calledDisableServerHeaderin the following Registry key and set the value to1.

HKLM\SYSTEM\CurrentControlSet\Services\HTTP\Parameters

40bb2ea5501a8b95588d6342165c22b6.png

After adding the Registry key, restart the HTTP service using thenet stop httpcommand and thenet start httpcommand. If the HTTP service doesn’t start up then use theiisresetcommand. If that also doesn’t work then you can restart the server.

Please note that this method is used only when the Server header comes as “Microsoft-HTTPAPI/2.0”.

When the request comes to IIS, it is first goes to http.sys driver. HTTP.SYS driver either handle the request on its own or send it to User mode for further processing. W

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值