Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a reverse proxy which will rewrite all requests to a particular URL to another server inside the DMZ. I got the setup and configuration working based on this article

So my basic setup is like this -

Base URL which should trigger rewrite - http://MySite/Custom?Data=123

Proxy URL - http://MyProxyServer/Service?Data=123

My problem is with the two BOLD keywords above! I just cannot seem to successfully rewrite all requests to new URL.

Explaining in detail -

When i use the following rule -

<rule name="ReverseProxy" stopProcessing="true">
   <match url="Custom/(.*)" />
   <action type="Rewrite" url="http://MyProxyServer/Service{R:1}" />

I get an 404 error saying http://MySite/Service not found!

Tracing using failed req logs, i can see the rules working perfectly (new url is created correctly) but eventually the request ends with 404 error.

Thing is, if i slightly tweak the rule, everything works fine.

Following rule works -

<rule name="ReverseProxy" stopProcessing="true">
   <match url="Service/(.*)" />
   <action type="Rewrite" url="http://MyProxyServer/Service{R:1}" />

But i have to change my base url to http://MySite/Service?Data=123 from http://MySite/Custom?Data=123

So is there a limitation with reverse proxy implementation in IIS 7 where we have to match the sub directory/virtual directory names between source and proxy or are my rules inadequate?

share|improve this question

Your Answer


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

Browse other questions tagged or ask your own question.