KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Proxying to private servers when using ISAPI_REWRITE as a front end to 4D
PRODUCT: 4D | VERSION: 11 | PLATFORM: Win
Published On: April 15, 2011

When using the approach discussed in Technical Note 09-27: IIS and ISAPI ReWrite; if the server you are trying to redirect to is not directly accessible by the client machine (i.e. the web browser cannot contact the destination directly) then you will want to do a Proxy and not a Redirect.

We can get a feel for the basic syntax by looking at the examples from Helicon's website:

Example 1: Running servers behind IIS

Assume we have an internet server running IIS and several corporate servers running other platforms. These servers are not directly accessible from the internet but only from our corporate network. Here is a simple example how to map another server into the IIS site's namespace using proxy flag:

[ISAPI_Rewrite]
RewriteProxy /mappoint(.+) http\://sitedomain$1 [I,U]


Using this approach the httpd.conf for the Helicon softweare may look this:
# **** Example Code Start ****
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.79

AllowOverride All
RewriteEngine On

# begin proxy requests for /server1 to server @ IP .100
RewriteProxy /server1(.+) http\://192.168.1.100$1 [I,U]
# end proxy requests for /server1 to server @ IP .100

# begin proxy requests for /server2 to server @ IP .110
RewriteProxy /server2(.+) http\://192.168.1.110$1 [I,U]
# end proxy requests for /server2 to server @ IP .110

# begin proxy requests for /server3 to server @ IP .122
RewriteProxy /server3(.+) http\://192.168.1.122$1 [I,U]
# end proxy requests for /server3 to server @ IP .122
# **** Example Code End ****


Using the same approach but for sub-domains instead of sub-directories may look like this:
# **** Example Code Start ****
# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.79

AllowOverride All
RewriteEngine On

# Begin Redirect ww1 to 211
RewriteCond %{HTTP_Host} ^ww1\.exampleurl\.org$
RewriteProxy (.*) http\://192.168.1.211/$1 [I]
#End Redirect ww1 to 211

# Begin Redirect ww3 to 113
RewriteCond %{HTTP_Host} ^ww3\.exampleurl\.org$
RewriteProxy (.*) http\://192.168.1.113/$1 [I]
#End Redirect ww3 to 113
# **** Example Code End ****

See Also: