angular - 使用对非 ASP .net 应用程序不起作用的 URL 重写从响应中删除服务器 header 。

标签 angular http iis http-headers iis-8.5

使用 url 重写出站规则从响应中删除服务器变量不起作用。应用程序是 Angular 4 应用程序,我的服务器是带有 iis 8.5 的 Windows 8,我的 web.config 数据如下所示。

   <?xml version="1.0" encoding="UTF-8"?>
      <configuration>
<system.webServer>
    <rewrite>
        <outboundRules rewriteBeforeCache="true">
            <rule name="remove server header">
                <match serverVariable="Response_Server" pattern=".+" />
                  <action type="Rewrite" value="MyServer" replace="true" />
            </rule>
        </outboundRules>
    </rewrite>
</system.webServer>

最佳答案

你需要添加这个

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

关于angular - 使用对非 ASP .net 应用程序不起作用的 URL 重写从响应中删除服务器 header 。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46047089/

相关文章:

firebase - 如何发出 firestore REST API PATCH 请求?

html - 如何在 css 中使::before/::after 元素可点击?

javascript - 即使我的数据源 _sort 变量确实发生了变化,Mat-sort 也不起作用

javascript - 如何通过嵌套的 ng-containers 和 ng-templates 传递数据?

angular - 将 Angular 7 更新为 Angular 9 后,无法读取 null 的属性 'fileName' 中的错误

javascript - 使用 npm 请求库时未保存 Cookie

违反发布要求的 HTTP 403 或 406?

asp.net - ASP.NET MVC 中的 session cookie 持久性

visual-studio - VS2010 回收 IIS 应用程序池时出错 : Not Found

iis - 如何在事件日志中查找应用程序池回收