0

I have set the following configuration set for a reverse proxy using ARR + URL Rewrite IIS7.5

I am trying to proxy www.originurl.com/e/ through front end site www.proxyurl.com/.

Note I'm mapping the proxy url to the origin url with a virtual directory. I get a 500 error. Any ideas as to what I'm doing wrong here?

<?xml version="1.0" encoding="UTF-8"?> 
<configuration>
<system.webServer>
    <rewrite>
        <rules>
            <rule name="ReverseProxyInboundRule1" stopProcessing="true">
                <match url="(.*)" />
                <conditions>
                    <add input="{CACHE_URL}" pattern="^(https?)://" />
                </conditions>
                <action type="Rewrite" url="{C:1}://www.originurl.com/e/{R:1}" />
            </rule>
        </rules>
        <outboundRules>
            <rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
                <match filterByTags="A, Form, Img" pattern="^http(s)?://www.originurl.com/e/(.*)" />
                <action type="Rewrite" value="http{R:1}://www.proxyurl.com/{R:2}" />
            </rule>
            <preConditions>
                <preCondition name="ResponseIsHtml1">
                    <add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
                </preCondition>
            </preConditions>
        </outboundRules>
    </rewrite>
</system.webServer> 
</configuration> 

1 Answers1

0

To proxy you should instead use Application Request Routing (ARR) module. That is a true reverse proxy option.

A 'redirect' is a client-side redirect to another URL, and a 'rewrite' (in your example) changes the URL on the back end before it hits disk, but it's not a proxy. A rewrite is local to the same site and it can't cross app pool bounds.

Scott Forsyth
  • 16,449
  • 3
  • 37
  • 56