No need to write much, this blog post is very good :) http://seanmcgary.com/posts/haproxy---route-by-domain-name