Question How redirect url request to a local VM

sponge_b0b

Honorable
Nov 12, 2017
76
1
10,545
Hi everyone,

I have two Virtual Machine inside the computer A.

JxXZqbB.png



I would like the outside people be able to reach one hosted website on the VM1
I would like the outside people be able to reach both hosted website on VM1 and the other one on VM2 (depending their respective url)

Is there any possibility inside either by my MikroTIK router or Computer A (Windows 8.1 host) or trough VirtualBox to redirect an URL to the specified VM ?

I'm using a Dynamic DNS (VM1.DDNS.com for example)

If not possible did you know another alternative ? (even if I have to put a machine between the router and the Host

Thank you :)
 
Last edited:
I believe that if you used a static IP for those VMs and have them shared with virtual switch or something then it will will act like normal PCs right?
I don't have experience doing those hosting kind of stuff but ones i have used RDP to connect to one of VMs from the outside computer by forwarding a port on my home router.

See if this helpful to set up your router
https://www.dynu.com/Resources/Tutorials/DynamicDNS/RemoteDesktop
 
What VirtualMachine' host are you using?

If you configure these machines to talk directly to PC-A' network adapter, they will get IP address from the router (or you can assign them static IP address from the same place), and then you port-forward on the router in the same way as if you'd forward to PC-A, but on different IP address.
 

sponge_b0b

Honorable
Nov 12, 2017
76
1
10,545
Hi everyone, thank you for your reply.

Actually those VM get their IP via DHCP from the ISP modem (I can reserved them ~fix)

I know how to forward port 80 and 443

But forwarding all the 80 port traffic to the VM 1 don't interest me, because the VM 2 also host website

so depending of the url the traffic have to go to the VM 1 or VM 2
 
I am no server guy so I only know the general methods. What server hosting site did before was they has 2 dns entries point to the same ip address. The traffic came into a central load balancing vm. It would look inside the headers and then direct the traffic to the proper vm based on dns names included in the url headers. Now that traffic is encrypted it is not so simple. I suppose the load balancing vm could do the HTTPS encryption function and then pass it to the other vm with http ? Not sure again I am not a server guy.

The other method is to use different ports which is a pain. I know DNS has a function called SRV that minecraft servers use to include the port number in the DNS lookup but I don't know if any browsers support it.