I have a home server exposed with NoIP, with a wildcard domain.
I have some services that run on some TCP ports (mainly game servers), and I am trying to sort of "assign" each of them a subdomain. To do this, I have a virtual network interface with multiple IPs where I can publish multiple instances of the same kind of service (two game servers for the same game, for example) and use the same port on all of them.
I have an proxy manager set up that I use to proxy HTTP requests depending on the subdomain to different sites (so http://dashboard.example.com goes to my control panel, http://amp.example.com goes to my application manager, etc.)
Since all subdomains go to the same IP address and I have no way to change that (because it's my own public IP and I only have one), I need to proxy the connections from the LAN host of the server to the corresponding virtual addresses.
My proxy manager (Nginx Proxy Manager) handles TCP proxies, but it does not check for the subdomain, so if I have two services running on port 6789 (each on their own virtual host), I can only proxy the connection to one of them, or use a different port outside. The service would also be available on all subdomains, which I don't want.
How can I achieve this?
TL;DR: I want to proxy TCP connections to different hosts based on the subdomain they came through, like with HTTP proxying