Introduction
I have one router, running pfSense (can be anything since it's a virtual machine on VMware, so if the solution requires anything else, that's fine by me) and behind it I have multiple virtual machines (NAT).
What I'd like to accomplish
I'd like to use a proxy of some sort to use multiple services with 1 IP, preferably based on DNS. For example; running a mail server (and website for webaccess) on mail.domain.com and running a website on www.domain.com and running a FTP server on ftp.domain.com, but all are a different virtual machine.
So basically:
Hostname Internal NAT IP Port
www.domain.com 192.168.1.10 80
mail.domain.com 192.168.1.11 25
mail.domain.com 192.168.1.11 80
mail.domain.com 192.168.1.11 443
ftp.domain.com 192.168.1.12 21
So I thought of using HAProxy, but HAProxy only allows this for HTTP traffic and not for "regular" TCP traffic (based on DNS name). I'd like to have all ports (both TCP and UDP, but if TCP is only possible then it's fine aswell) to be redirected to the respective virtual machine.