Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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> 
share|improve this question

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.