【问题标题】:Rewrite not working anymore after moving to IIS 8.5迁移到 IIS 8.5 后重写不再工作
【发布时间】:2020-08-06 10:41:34
【问题描述】:

我在 IIS 中配置了 2 个站点,其中一个站点针对特定的子路径重写到另一个站点。每个站点本身似乎都已正确配置并且可以正常工作。

因此,如果我调用 http://site2/some/path - 我会得到想要的结果,但调用 http://site1/api/some/path 时会得到 404.4。

site1 的web.config 中的重写规则如下所示:

<rule name="Rewrite API" enabled="true" stopProcessing="true">
    <match url="api/(.+)" />
    <action type="Rewrite" url="http://site2/{R:1}" appendQueryString="true" />
</rule>

有趣的是,如果我将操作类型设置为Redirect,我实际上会被重定向,但这不是我想要实现的。

另外值得一提的是:此设置在 IIS 7 下工作。

【问题讨论】:

    标签: iis iis-7 iis-8


    【解决方案1】:

    This answer actually was everything I needed to do, but I didn't find it over Google, only in the related questions section here

    我所要做的就是在 IIS 中使用“Web 平台安装程序”安装“应用程序请求路由”,然后激活它以能够反向代理。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-27
    • 1970-01-01
    • 2015-09-20
    • 1970-01-01
    • 2016-07-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多