I'm in the process of migrating from one site to another and, although the websites sit on the same server, they aren't in the same application pool.
As such, what I'm proposing is similar to the IIS article 'Reverse Proxy with URL Rewrite v2 and Application Request Routing'.
My setup as as follows:
I've enabled proxying in the ARR module and have one rewrite rule in 'New Website'. Currently, I only have one page in the new site (new-page), but this will increase gradually as we migrate over.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Reverse Proxy to New Website" stopProcessing="true">
<match url="^new-page" />
<action type="Rewrite" url="http://www.mysite.com:81/new-page" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
When I go to www.mysite.com/index.htm, I see my old homepage, which is correct.
However, if I go to www.mysite.com/new-page, I receive an error:
HTTP Error 502.3 Bad Gateway
The server returned an invalid or unrecognized response
Any help with this would be greatly appreciated.
Edit:
I have also enabled WinHttp tracing, and a log of the request today can be found here at pastebin.
I have some further information (retrieved from IIS Failed Request Logging) below.
It appears that ARR has an issue with headers that have spaces in.
The new application has a single header with a space, and replacing it with a hyphen fixed the issue.