【问题标题】:IIS Reverse proxy with multiple rules具有多个规则的 IIS 反向代理
【发布时间】:2020-03-11 14:04:02
【问题描述】:
<rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="^a/(.*)" />
                <action type="Rewrite" url="http://localhost:8086/{R:1}" />
            </rule>
            <rule name="ReverseProxyInboundRule2" stopProcessing="true">
                <match url="^b/(.*)" />
                <action type="Rewrite" url="http://localhost:8085/{R:1}" logRewrittenUrl="true" />
            </rule>
        </rules>
    </rewrite>

在任何时间点,只有一个规则有效,另一个规则会给出 404 错误。 如果http://localhost/a/xxx 有效,则http://localhost/b/yyy 给出404 错误。

【问题讨论】:

标签: iis url-rewriting reverse-proxy arr


【解决方案1】:

这两个规则在我的环境中并行工作。您是否收到 404.4 错误? 如果是,请在IIS管理器->服务器节点->应用请求路由缓存->服务器代理设置->启用代理中安装应用请求路由并启用转发代理。

https://www.iis.net/downloads/microsoft/application-request-routing

如果不能解决问题,请启用失败的请求跟踪并发布您所看到的内容。

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-10-24
    • 1970-01-01
    • 2018-07-23
    • 1970-01-01
    • 2020-05-23
    • 1970-01-01
    相关资源
    最近更新 更多