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 *:8080>
        CustomLog logs/access_proxy_log combined
        RewriteEngine On
        RewriteLogLevel 9
        RewriteLog logs/rewrite_log

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

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