Notes on interceptor proxy configs

Apache mod_proxy

(with thanks to Davi)

This is a test setup to both proxy specific local requests to a daemon on a non-standard port and to intercept proxy requests for a specific hostname (which is damn useful for testing clients with hardcoded URLs):

Listen 80
Listen 8080

NameVirtualHost *:80
NameVirtualHost *:8080

<VirtualHost *:80>
        RewriteEngine On
        # Proxy to Snakelets and Dowser
        RewriteRule ^/snakelets proxy:http://localhost:9080/ [L]
        RewriteRule ^/dowser(/.*) proxy:http://localhost:9081/$1 [L]
</VirtualHost>

<VirtualHost *:8080>
        CustomLog logs/access_proxy_log combined
        RewriteEngine On
        RewriteLogLevel 9
        RewriteLog logs/rewrite_log

        <Location />
                Allow from 127.0.0.1 192.168.
                Deny from all
        </Location>
        # Proxy requests to the.taoofmac.com and send them to debugger
        RewriteCond %{HTTP_HOST} the.taoofmac.com
        RewriteRule (^/space/.*) proxy:http://192.168.0.2$1 [L]

        # Proxy everything else normally
        RewriteRule (.*)        proxy:http://%{HTTP_HOST}$1 [L]
</VirtualHost>