理解 IIS 中的重写规则存在的问题

理解 IIS 中的重写规则存在的问题

我之前写过尝试理解使用 nginx 和 Windows IIS 进行反向代理。当 Upwork 雇用的专家研究这个问题时,我正在研究仅使用 IIS 进行反向代理。

此重写规则存在问题,但我对此还不太熟悉,无法发现问题。这是从 web.config 文件中切出的重写规则(并略微匿名化):

<rewrite>
    <rules>
        <rule name="ReverseProxyInboundRule1" stopProcessing="true">
            <match url="(.*)" />
            <action type="Rewrite" url="http://our.server/third/{R:1}" />
        </rule>
    </rules>
    <outboundRules>
        <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
            <match filterByTags="A, Form, Img" pattern="^http(s)?://our.server/third/(.*)" />
            <action type="Rewrite" value="http{R:1}://www.third.com/{R:2}" />
        </rule>
        <preConditions>
            <preCondition name="ResponseIsHtml1">
                <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
            </preCondition>
        </preConditions>
    </outboundRules>
</rewrite>

当我尝试使用此规则时,我从网络浏览器获得的响应是

Detailed Error Information:
Module     ApplicationRequestRouting
Notification       MapRequestHandler
Handler    ApplicationRequestRoutingHandler
Error Code     0x00000000
Requested URL      http://our.server:80/third/third/third/third/third/third/third/third/third/third/third/third/au/mz
Physical Path      C:\web\projects\third\third\third\third\third\third\third\third\third\third\third\third\au\mz

那么是什么导致了这三分之一的现象呢?

相关内容