Rewriting IIS Url Rewriter URLs Fail, but Redirecting Fails

I need to configure several applications on a new intranet server (Win 2008 R2 Standard SP1). I'm having difficulty with the Rewriter URL rule. I had a similar rule working fine on my local IIS (Win 7). This rule is intended to create a reverse proxy for a web service that allows jQuery AJAX requests from the client to avoid XSS.

The rule is given below, and if I use it as is, and enter the URL of the example into the browser:

http://srv01.domain.com/serviceproxy/workflow/Users/GetUsers?q=smith&max=10 

I get a 404 response from the server. If I change the type to Redirect, I get a response from the expected server (but, obviously, this will invalidate my attempt to avoid XSS).

 <rewrite> <rules> <rule name="Reverse Proxy - WCF Service" stopProcessing="true"> <match url="serviceproxy/workflow/(.+)" /> <action type="Rewrite" url="http://srv01.domain.com/WorkflowService/{R:1}" /> </rule> </rules> </rewrite> 

Any ideas that might be missing from the server configuration? Is this a security setting somewhere that needs to be configured to allow rewriting to occur?

+4
source share
2 answers

I found my problem. On this server, I did not have application request routing. Either I forgot to install it on another server, or it was already there for another reason.

Found this article that helped me solve it.

http://www.iis.net/learn/extensions/url-rewrite-module/reverse-proxy-with-url-rewrite-v2-and-application-request-routing

+2
source

Had a similar problem in Windows 2008, IIS 7.5 The problem was that the application pool was in integrated mode. which caused rewriting problems. The redirection was always normal, but it was never possible to rewrite.

changed the application pool to classic mode and the problem was 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 this.

+1
source

All Articles