首页 > 解决方案 > 无法在 IIS 8.5 中使用 URLRewrite 删除服务器标头详细信息

问题描述

我有两个关于 URLRewrite 模块的查询。

  1. 为了从标头中删除服务器信息,我在 IIS8.5 中安装了 URLRewrite 模块并在 web.config 中添加了更改。
  <outboundRules rewriteBeforeCache="true">
    <rule name="Remove Server header">
      <match serverVariable="RESPONSE_Server" pattern=".+" />
      <action type="Rewrite" value="" />
    </rule>
  </outboundRules>
</rewrite>

但我仍然能够看到服务器详细信息。我是否需要在 IIS 中配置这些值才能工作?

  1. 另外,URLRewrite 会导致响应时间延迟吗?

标签: iishttp-headersiis-8url-rewrite-module

解决方案


1.我测试了你的 outboundRules,它在我这边工作正常。你添加RESPONSE_Server到服务器变量了吗?如果没有,请添加它。

在此处输入图像描述

在此处输入图像描述

2.URL Rewrite会导致响应时间延迟,但通常可以忽略。


推荐阅读