I'm trying to setup a reverse proxy for my website. Basically, I have an external site
example.com/site/folder that needs to reverse proxy to some internal VMs. Here's a little background
- All machines run Server 2008 (Standard)
- 1 machine (the reverse proxy
server.example.com) has an external IP
- Several other internal VMs run IIS 7 and Server 2008
I've got the reverse proxy working and I can successfully send requests matching
example.com/site/folder/ over to
However I'm having problems with 301 redirects that are returned by the internal VMs. When the user goes to
http://example.com/site/folder without the trailing slash, the internal VM shoots back a redirect to go to
folder/. This causes a 404 at the host machine level because
example.com/folder/ does not exist.
server.example.com I added the pre-configured URL rewrite rule to append the trailing slash for me --- but when I enable this rule it seems to be too broad. Although it fixes the 404 errors and forces the client from
folder/ before it is proxied, the rule also adds a
/ to regular requests (ie.
example.com/site/images/test.jpg/) This causes a 404 at the VM level because there is no file that matchines
Any thoughts on how to get around this? I'd prefer to make all changes at the host machine level (rather than the VMs) -- but if I absolutely have to change the VMs I can do that.