Wednesday, February 13, 2008

Reverse Proxy with IIS

Have you ever needed to do reverse proxy using IIS? if yes, read on.

You need to have ISAPI REWRITE product from here
Install on your IIS server and put the following code:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^my.external-domain.com$

RewriteProxy ^(.*) http://my.internal-domain.com:9999/$1 [H,A,L]

This allows you to access my.external-domain.com from the Internet over HTTP (Port 80) and then proxied by IIS with the help of ISAPI to your my.internal-domain.com port 9999 which is located on the other internal 'inaccessible-from-the-Internet' server.

Monday, February 04, 2008

Windows Systems Wide Proxy

Sometime an application needs to be able to use a proxy to run properly. The best approach to do this is the application is able to adapt with the Internet Explorer proxy setting.

However, some applications are not 'smart' enough to get the proxy setting from the IE, therefore, a systems wide setting must be set.

Prior to Windows Vista, systems wide proxy setting is set by using: proxycfg.exe
With Windows Vista, you need to do:

netsh
netsh> winhttp
netsh winhttp> set proxy proxy.domain.tld:8080

Note: You must run this from CMD 'run as administrator'