Problems with understanding rewrite rules in IIS

1

I wrote earlier about Trying to understand reverse-proxying using nginx and Windows IIS. While the upwork-hired specialist looks into that, I'm looking into just using IIS to do reverse proxying.

There's something wrong with this rewrite rule but I'm too new to this to see it. This is the rewrite rule sliced out of the web.config file (and anonymized slightly):

<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>

The response I get from the web browser when I try to use this rule is

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

So what's causing all these thirds?

iis
reverse-proxy
rewrite
asked on Server Fault Jul 16, 2020 by bugmagnet

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0