How to Configure IIS 6 as a Reverse Proxy for Apache/Linux Web Server Using Host Headers


4 views

When managing multiple websites on IIS 6 with host header configurations, you might encounter situations where certain sites need to be served from a different backend server (like Apache on Linux). This requires configuring IIS as a reverse proxy.

Unlike IIS 7+ which has ARR (Application Request Routing) module, IIS 6 lacks built-in reverse proxy functionality. You'll need one of these approaches:

  • ISAPI Filter solution (like Helicon Ape)
  • URL Rewrite + Proxy combination
  • Third-party reverse proxy add-ins

Here's how to configure Helicon Ape (ISAPI filter) as reverse proxy:

# In .htaccess file for the specific site
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://linux-server:8080/$1 [P]

Key configuration in httpd.conf:

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
ProxyPass / http://linux-server:8080/
ProxyPassReverse / http://linux-server:8080/

For ISAPI Rewrite 3.x users:

[ISAPI_Rewrite]
RewriteCond %{HTTP:Host} ^yourdomain\.com$
RewriteRule ^(.*)$ http://linux-server:8080$1 [P]

When implementing reverse proxy in IIS 6:

  • Enable kernel-mode caching if possible
  • Adjust connectionTimeout (default 120s) in metabase.xml
  • Monitor ISAPI filter memory usage

Common issues and solutions:

# Check if ISAPI filter is loaded
cscript adsutil.vbs GET /W3SVC/Filters/Loaded
# Verify rewrite logs in Helicon Ape
LogLevel 9
RewriteLog "C:\rewrite.log"

When running multiple websites on IIS 6 with host header bindings, redirecting specific traffic to external servers requires careful configuration. The core issue lies in IIS's default behavior of handling all requests locally rather than forwarding them.

While IIS 6 doesn't include built-in reverse proxy capabilities like newer versions, we have several approaches:

  • URL Rewrite + ARR (Requires IIS 7+) - Not available for IIS 6
  • ISAPI Filters - Complex but powerful
  • Application Request Routing Add-on - Requires additional installation

Here's a configuration example using Helicon Tech's ISAPI_Rewrite (a popular commercial solution):

RewriteEngine on
RewriteCond %{HTTP_HOST} ^linuxsite\.example\.com$ [NC]
RewriteRule ^(.*)$ http://192.168.1.100:8080/$1 [P]

For a free alternative, consider these steps:

  1. Install Microsoft URL Rewrite Module
  2. Create a new website in IIS for your Linux-hosted domain
  3. Set up an HTTP redirect rule:
<rule name="Proxy to Apache" stopProcessing="true">
    <match url="^(.*)" />
    <conditions>
        <add input="{HTTP_HOST}" pattern="^linuxsite\.example\.com$" />
    </conditions>
    <action type="Rewrite" url="http://apache-server:80/{R:1}" />
</rule>

When implementing proxy solutions:

  • Enable HTTP keep-alive to maintain connections
  • Adjust connectionTimeout in applicationHost.config
  • Monitor failed request tracing for troubleshooting

Watch for these pitfalls:

  • Host header preservation - Apache may need ProxyPreserveHost On
  • SSL certificate mismatches
  • Port conflicts between IIS and Apache