Configuration of VPS

0

I am putting together a VPS that will have 3 virtualized servers using the VB virtual machine.

Each machine has a distribution of Ubuntu Server 14.04 installed that executes some services built by me in java that listens to certain ports requests.

I have a single certified IP, 2 domains and a sub-domain.

Both the 2 domains and the sub-domain point to the certified IP that is attached to a firewall and then redirect the ports to one of the virtual servers.

But my need is this:

dominioA.com --- servidor1 (10.1.1.2)
dominioB.com --- servidor2 (10.1.1.3)
sub-dominio ---- servidor3 (10.1.1.4)

As it is not HTTP traffic I can not use the reverse Apache proxy.

My question is, how do I redirect, depending on the domain, to my local servers (IPs)?

I understand that with a DNS server that is achieved, so I enabled a 4 a virtual machine with Ubuntu Server and bind9, I tried to document, I made some tests and I can not get it to work .

So I hope someone with knowledge or experience will shed more light on the possible solution.

    
asked by Hector Diaz 26.01.2017 в 14:57
source

1 answer

0

I am afraid that this type of redirection can only be carried out from the application layer, putting some kind of reverse proxy that routes the client's request according to a header sent by the client indicated by the host, but for that the services has to speak some protocol that allows this kind of headers, like http.

link

One way to fix it is to do the routing through the port, so that each service has a single port associated with it, and so from the firewall you can redirect each port to its corresponding machine.

dominioX:puerto1 -> 10.1.1.2 dominioX:puerto2 -> 10.1.1.3 dominioX:puerto3 -> 10.1.1.4

    
answered by 26.01.2017 в 16:09