Check the docs. I think if I remember the last time I did something like this, it was easiest to just put different hostnames for my sites and use the header begin acl or something like that.
So I had something like admin.domain.com, clients.domain.com and transfer.domain.com, all pointing to the same IP and haproxy redirecting to different backends based on the host name. I’m sure you could parse paths too if you look through the docs and find the right function.
[quote=261842:@Kevin Windham]Check the docs. I think if I remember the last time I did something like this, it was easiest to just put different hostnames for my sites and use the header begin acl or something like that.
So I had something like admin.domain.com, clients.domain.com and transfer.domain.com, all pointing to the same IP and haproxy redirecting to different backends based on the host name. I’m sure you could parse paths too if you look through the docs and find the right function.[/quote]
Well, my problem here is SSL. A wildcard certificate for any number of 3rd level domains, as you suggest above, costs much more than a simple certificate for one domain (like shop.myapp.com, as an example above).
So I was trying two things:
adding a path and then add an acl with path_beg, as show above
using a different hostname and use it unsecured (http), but then let haproxy switch to https and forward to a specific backend pool.
But somehow the docs and examples have not been helpful, so far.
Haproxy is not exactly well documented…
Also, I would work with just the ACLs and backend sections first. Having the other redirects and such in there will confuse the issue until you know your frontends are properly connecting to the backends you want.