Please accept my apologies if this is off topic or does not apply on a more broad scale (i've searched the internet and can't seem to find a solution anywhere). I'm not sure if this is even possible, if you have any suggestions that will work better or just let me know it won't work. I'm new to HAProxy. Be kind (lol)
I'm using HAProxy for HTTP and HTTPS proxy connections for web servers, what I'd like to do is do the same with a farm of servers I have. The only problem I am running into is that each of those servers includes email (Postfix and Dovecot usually) for the emails attached to them.
I'm trying to setup the same things but for multiple domains and for email. For example I would have a public ip address assigned to an HAProxy server, internally it would query each server and find the server that has that domain and then transfer the data to that server.
Cheesy Text Diagram:
- joe@example.com - HAProxy >> Server 4
- joe@example2.org - HAProxy >> Server 1
- joe@example.net - HAProxy >> Server 2
I'm looking to do this dynamically, so if example.net is moved from Server 2 to Server 3, it will change accordingly. Again....I do not know if this is possible, and I've spent about 3 weeks researching and trying to find information on this, but not on the scale in which I'm looking to do.
Any help would be greatly appreciated, as I've said if this can be accomplished with another program other such as Nginx reverse proxy please let me know.