I configured IIS as a reverse proxy using Url Rewrite module and ARR 3. I have a public domain which redirect to my application on localhost. It's working fine excepted when the application redirect to another host. ie: redirecting to "https://www.google.com/search?q=url+rewrite+iis+arr+3" My browser shows "http://localhost/search?q=url+rewrite+iis+arr+3" which fails
The hosted application is using Asp Net Mvc with framework.net 4.5. The application is working with integrated pipeline in IIS application pool configuration.
Using Fiddler, I can see the following trace on redirect :
HTTP/1.1 302 Found
Cache-Control: private
Content-Length: 350
Content-Type: text/html; charset=utf-8
Location: http://localhost/search?q=url+rewrite+iis+arr+3
Server: Microsoft-IIS/7.5
X-Powered-By: ARR/3.0
X-Powered-By: ASP.NET
Date: Wed, 02 Nov 2016 16:39:18 GMT
<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="https://www.google.com/search?q=url+rewrite+iis+arr+3">here</a>.</h2>
</body></html>
My IIS config :
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="http://localhost/{R:1}" />
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="IsRedirection" stopProcessing="true">
<match filterByTags="A" pattern="^http(.*)" negate="false" />
<action type="None" />
</rule>
<preConditions>
<preCondition name="IsRedirection">
<add input="{RESPONSE_STATUS}" pattern="3[0-9][0-9]" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
Thanks to milope on IIS.net forums (don't know if I can post the link) for giving me the following solution:
This worked for me and solved my redirect issue.