Internet Information Services 5.x and 6.0

Internet Information Services (IIS) 5.x and 6.0 have no built-in tools to do load balancing. However, third party tools do exist.

One third-party tool is ISAPI_Rewrite, which aims to enable Apache mod_rewrite on IIS.

Sessionless requests

The following example shows how to configure the ISAPI_Rewrite filter to do load balancing for sessionless requests. It assumes the architecture illustrated by the sample architecture 1.
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.66

RewriteEngine on

RewriteMap servers rnd:hosts.txt

RewriteRule ^/(.*) http://${servers:host}/$1 [P,L] 

For example, the http://localhost/ws/r/echo URL will be rewritten to http://GAS1.corporate.com/ws/r/echo, assuming that the GAS1.corporate.com server has been chosen.

Session-bound requests

The following example shows how to configure the ISAPI_Rewrite filter to do load balancing for session-bound requests. It assumes the architecture illustrated by the sample architecture 2. ISAPI_Rewrite doesn't support cookie-based request routing. The example illustrates path-based session-bound request routing.
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.66

RewriteEngine on

RewriteMap servers rnd:vdirs.txt

RewriteRule ^/gas/(.*) /${servers:vdir}/$1
RewriteRule ^/GAS1/(.*) http://GAS1.corporate.com/GAS1/$1 [P,L]
RewriteRule ^/GAS2/(.*) http://GAS2.corporate.com/GAS2/$1 [P,L]

For example, the http://localhost/gas/wa/r/gwc-demo URL will be rewritten to http://localhost/GAS2/wa/r/gwc-demo, assuming that the servers:vdir variable contains GAS2 at this time, then will be rewritten to http://GAS2.corporate.com/GAS2/wa/r/gwc-demo. Likewise, the http://localhost/GAS2/wa/sua/93837374/1 URL will be rewritten to http://GAS2.corporate.com/GAS2/wa/sua/93837374/1.