asp.net - 为什么removeServerHeader可以在Azure Web App中工作?

标签 asp.net azure iis web-config

other SO questions 中所述Windows Azure Web Apps 运行在 IIS/8.0 上,但我怀疑这是否属实。

首先,当我检查在 Azure Web Apps 免费层上运行的 Web 应用程序的 HTTP 响应时,我可以看到以下 HTTP header :

Server:Microsoft-IIS/8.0

但是,根据this documentation在我的机器上进行一些本地测试,我知道 IIS 8.0 不支持 requestFiltering removeServerHeader

例如:

<configuration>
  <system.webServer>
    <security>
      <requestFiltering removeServerHeader="true" />
    </security>
  </system.webServer>
</configuration>

这是一个 feature which has been added with IIS 10.0我可以通过在带有 IIS 10.0 的 Windows 10 VM 上运行更多测试来确认这一点。

有趣的是此设置也适用于我的 Azure Web App,据说它在 IIS 8.0 上运行,所以我的问题是 Azure Web Apps 实际运行在哪个版本的 IIS 上?

编辑: 从下面的所有评论来看,Azure Web 应用程序似乎在 IIS 8.0 上运行,因此我将我的问题重新表述为:当 Azure Web 应用程序在 IIS 8.0 上运行时,removeServerHeader 如何在 Azure Web 应用程序中工作?

最佳答案

一个blog post from Microsoft in 2013 states :

Our customers asked us to allow these headers to be disabled on Azure Web Sites, and so with the recent release of Windows Azure Web Sites, we have enabled this to be done.

然后它继续给出使用 removeServerHeader 的示例,并表示它是请求过滤模块的一部分:

The removal of these headers is facilitated with the Request Filtering module...

有趣的是their documentation for IIS 10 Request Filtering确认 removeServerHeader 属性已添加到 IIS 10,正如您所发现的那样。

New in IIS 10.0

IIS 10.0 added the removeServerHeader attribute to suppress sending the HTTP server header to remote clients.

所以我想说,它在 Azure 网站上运行的原因是,微软在 2013 年应客户的请求将该功能推出到 Azure 网站 - 可能是作为请求过滤模块的 Azure 特定版本的一部分。此后,他们将其作为标准集成到 IIS 10 请求过滤模块中。

关于asp.net - 为什么removeServerHeader可以在Azure Web App中工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33040769/

相关文章:

c# - 通过 C# 与 IIS 交互

java - .innerHTML 未定义

c# - 如何对枚举进行空检查

asp.net mvc 键 'attachdbfilename' 的值无效

asp.net-mvc - SignalR 似乎减慢了我的 MVC/Azure 应用程序的启动速度

azure - 在 ARM 模板中应用 Azure Key Vault 无 self 权限属性

asp.net - CRM 2015 Linq Count() 查询 - 这是在枚举查询吗?

azure - Cortana Skill 是否支持使用 Azure AD B2C 帐户登录?

c# - 请求限制是否以 BITS/BYTES 为单位?

C# 代码更改未通过 IIS 反射(reflect)