I have servers with different services. Each service has its own ssh server to access to the service. Each ssh server it in a different port (e.g. 2022 and 3022).
Also, I have different domains to access the services. (a.dom.com, b.dom.com). The IP of both domains is the same (1.2.3.4) but I use the domains, with a reverse proxy, to access to different services.
It is possible to create a reverse proxy for ssh server too, that redirect a port (e.g. 22) to other ports depends on the domain.
My objective is that I can do ssh a.dom.com and ssh b.dom.com
I have tried with ssh tunnelling, with the following command: (Think that I have a third ssh server in the port 23)
ssh -p 23 localhost -R a.dom.com:22:localhost:2022 -R b.dom.com:22:localhost:3022
but It didn't work and I think that it is not correct because, in the command, the a.dom.com is an IP filter for the tunnel