I have multiple application servers on my LAN which I am trying to publish so that they would be accessible externally. They run on different ports on different machines. Why? Being a software house, we set up demo and test environments for short durations for clients.
At the moment, I have a Microsoft TMG server. It has the capability to do this as it has an option to publish according to HTTP headers. So I can publish demo1.company.com (forwarding to 10.0.0.1:80), demo2.company.com:8080 (to 10.0.0.2:8080), demo3.company.com:7070 (to 10.0.0.2:9090), etc.
In all cases the left part of rule (protocol and dst-port) is what original packet is targeting (from client’s machine) and the right part of rule (to-address and to-ports) defines to what those particular packet fields get rewritten (e.g. LAN server IP address and port number on that particular server).
Then, there’s the case of where a single server on the LAN that hosts multiple sites in Apache on port 80 that it serves according to host headers.
I could forward all port 80 requests to a single server that in turn forwards to individual machines. But then, instead of such a complicated set up, I’d be better off with TMG. It’s the TMG which I’m attempting to replace.
Dont know about TMG - but a slimline NGINX reverse proxy running on even a RPi (or small VM if you have VM hardware) is your only bet to route via host header. The Mikrotik only see’s the TCP stream and can’t really jump into the packets and determine host header - thats read by the webserver when it accepts the connection and starts talking HTTP protocol with the client.