arr url rewrite not working for external sites

3

We are trying to setup a reverse proxy mechanism using ARR and URL Rewrite. The rewriting is working fine when the target url is a one which is hosted in the same server. But when we try to route it to an external server the routing is now working. We are getting the

HTTP Error 502.3 - Bad Gateway
The operation timed out 

Module ApplicationRequestRouting 
Notification ExecuteRequestHandler 
Handler ApplicationRequestRoutingHandler 
Error Code 0x80072ee2 
Requested URL http://localhost:8882/ff 
Physical Path D:\pocwebsites\exposed\ff 
Logon Method Anonymous 
Logon User Anonymous 


•The CGI application did not return a valid set of HTTP errors.
•A server acting as a proxy or gateway was unable to process the request due to an error in a parent gateway.

•Use DebugDiag to troubleshoot the CGI application.
•Determine if a proxy or gateway is responsible for this error.

Please find the web.config file given below,

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    <rewrite>
        <rules>
        <rule name="or_rule_1" enabled="true">
            <match url=".*" />
            <action type="Rewrite" url="http://www.cnn.com" />
        </rule>
        </rules>
    </rewrite>
    </system.webServer>
</configuration>
url
iis
rewrite
arr
asked on Stack Overflow Jul 23, 2013 by user867662

2 Answers

6

We had a similar issue. Rewriting the url to a local site was no problem, but rewriting to an external site gave a bad gateway error.

We do have an internal proxy (the proxy you also set in IE to visit external sites). Setting this same proxy in the ARR reverse proxy page fixed our issue.

answered on Stack Overflow Oct 16, 2013 by GitteTitter
3

Had a similar issue on Windows 2008, IIS 7.5 The problem was that the app pool was in integrated mode. that caused issues with the rewrite. Redirect was always ok, but rewrite always failed.

i changed the app pool to classic mode and problem solved (at least for now).

a better solution might be http://forums.iis.net/t/1200671.aspx?ARR+URl+Rewrite+is+not+working+for+external+servers right at the end. but i havent tried it.

answered on Stack Overflow Jul 3, 2014 by Ismael

User contributions licensed under CC BY-SA 3.0