After working the awesome support team at Haproxy, I was able to come up with a unique configuration for my use case. I thought it would be of value to some to share it.
There are different ways to route layer 7 traffic. You can do it via hostname, fqdn, path, port or a combination of all of them. Here are some examples:
mydomain.com
myhost.mydomain.com
myhost.mydomain.com/mypath
myhost.mydomain.com:32000/mypath
Depending how you have structured your applications you will need to configure Haproxy for the type of routing you require. In this blog post we are going to talk exclusively about hostname routing. This means, that there will be a single domain name, however each route to a backend server will be based on the hostname.