Perlbal as a reverse proxy
I recently needed to set up a new reverse proxy as an alternative to pound, and for no particularly good reason chose Perlbal.
The documentation is fairly good, but I didn’t find many (good) examples of working configurations. So I thought I’d include my very simple conf.
LOAD vhosts
# Management service via telnet
CREATE SERVICE mgmt
SET role = management
SET listen = 127.0.0.1:16000
ENABLE mgmt
# Web server
CREATE POOL web
POOL web ADD 10.10.42.41:80
# Trac server
CREATE POOL trac
POOL trac ADD 10.10.42.42:80
CREATE SERVICE web_proxy
SET role = reverse_proxy
SET pool = web
ENABLE web_proxy
CREATE SERVICE trac_proxy
SET role = reverse_proxy
SET pool = trac
ENABLE trac_proxy
# Internally we use 'trac.internal.com' but externally it would
# be 'trac.external.com'. So rather than creating a second
# virtual host on our trac webserver, we re-write the header
HEADER trac_proxy REMOVE Host
HEADER trac_proxy INSERT Host:trac.internal.com
# Listen on our external IP
CREATE SERVICE selector
SET listen = 100.110.120.130:80
SET role = selector
SET plugins = vhosts
VHOST external.com.au = web_proxy
VHOST www.external.com.au = web_proxy
VHOST trac.external.com.au = trac_proxy
ENABLE selector