tags:

views:

292

answers:

3

Hello everyone,

I asked this question before and I already know how to use ISA Server 2006 to implement this function, my current question is how to implement the same function without using ISA Server but using pure IIS only. Does anyone have any ideas?

My development/deployment environment is, IIS + Windows Server 2003/2008 + .Net + VSTS2008 + C#. I have several web sites, each of them has stable and beta version, for example, I have beta version order system and stable version order system, the same as purchase system. I deployed the 4 systems on 4 different physical machines (machine name labvm1, labvm2, labvm3 and labvm4).

My requirement is, I want to have a common URL schema to access the different systems, like,

http://www.mycorp.com/order/beta
http://www.mycorp.com/order/stable
http://www.mycorp.com/purchase/beta
http://www.mycorp.com/purchase/stable

But since the 4 systems are deployed on 4 different physical machines with different machine/DNS name, how could I map the same domain (http://www.mycorp.com) with different suffix to different physical online systems?

thanks in advance, George

+1  A: 

One way is setting up a URL rewriting module with a Proxy function in the root server (the one at www.mycorp.com). The one I know is a commercial product from Helicon Tech, ISAPI Rewrite. Check the documentation at http://www.isapirewrite.com/docs/#RewriteProxy. They basically implemented all the features from the Apache Rewriting mod using the same syntax.

You would set rules like: RewriteProxy ^purchase/beta/(.*)$ http://192.168.0.12:8080/$1

Ariel Popovsky
Cool, Ariel, and are there any built-in function from either IIS 6 or IIS 7 which could achieve my purpose without another ISAPI module? :-)
George2
Hi Ariel, I find another issue when using IIS built-in redirection feature, the destination URL in IE browser becomes the internal machine name (e.g. labvm1), any ideas to change it to display external web site (www.mycorp.com) name? The purpose why I want to have such kind of redirection is I need to hide the internal machine name.
George2
Yes, IIS supports redirection so the user ends up in another url. Proxying is transparent to the user, the root server acts as a proxy so you can potentially redirect the user to a server that is inaccessible to him otherwise.
Ariel Popovsky
You should check the Application Request Routing module for IIS 7 if you are using win2008, I think it has some proxy features you could use for your scenario. http://www.iis.net/extensions/ApplicationRequestRouting
Ariel Popovsky
Thanks Ariel, if I have to use IIS 6.0 and do not want to use any additional software, there is no solution to hide the internal machine name in browser URL field and just display external domain/machine name?
George2
For IIS 6 I guess your only option is using an ISAPI addin.
Ariel Popovsky
You mean 3rd party add-in? Or Microsoft built-in?
George2
@Ariel, I read the Application Request Routing module for IIS as you recommended, and find very helpful. But I did not find a sample which is similar to my needs, mapping a path of external web site (domain) to an internal web server. Do you have any speciifc sample to recommend for a newbie like me? :-)
George2
+1  A: 

IIS7 URL Rewriting module does not currently support reverse proxy functionality so you'd better use ISAPI-Rewrite 3 or Helicon Ape mod-proxy module. The config for ISAPI_Rewrite will be similar to what Ariel provided:

RewriteBase /
RewriteProxy ^purchase/beta/(.*)$ http://192.168.0.12:8080/$1

And the config for Ape (Ape is designed specifically for IIS7) is:

ProxyRequests Off
<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>
ProxyPass /purchase/beta/(.*) http://192.168.0.12:8080/$1
TonyCool
Thanks TonyCool, I am considering using non-IIS built-in feature like ISAPI_Rewrite module you suggested. At the same time, I am also trying IIS built-in feature, and currently I find another issue, the destination URL in IE browser becomes the internal machine name (e.g. labvm1), any ideas to change it to display external web site (www.mycorp.com) name? The purpose why I want to have such kind of redirection is I need to hide the internal machine name.
George2
A: 

IIRF v2.0 supports a reverse proxy feature. With this feature you can can map a set of servers into a single URI namespace, hiding the internal machine names of the mapped resources.

IIRF is free, and works with IIS6 and 7.

Cheeso