O
O
Oleg Benikh2018-05-01 17:45:29
Proxmox
Oleg Benikh, 2018-05-01 17:45:29

How to correctly assign domains for proxmox virtual machines?

There is a server with virtual machines on proxmox (debian) and one external IP.
The task is to make it so that when moving from different domains to an external IP, different virtual machines open.
For example, there are domains: site1.ru, site2.ru, site3.ru.
When you enter site1.ru, one virtual machine opens, when you enter site2.ru, another virtual machine opens.
Questions are of interest: "is it generally possible to do this on proxmox?" and "is there any solution?".
According to the latter - at least the direction where to look, otherwise I rummaged through half of the Internet with different requests, I didn’t find anything sensible.
I'd be very grateful for any hints!
*** *** ***
PS. I found a similar question on the Internet. It sounds like this:
"There is a server, BIND9, proxmox is installed on it. Everything seems to be set up according to the" best recipes ". However, it became necessary for the site.ru domain to make a subdomain (sub.site.ru) and place it in a container (proxmox). Tell me how to set it up dns, so that at the address sub.site.ru, knocking on any port, I could get into the container (proxmox)."
Someone answered that question like this:
"If I understand the situation correctly, then the question is not so much about DNS, but about a virtual machine.
You seem to have a problem in accessing the virtual machine from the outside. The solution will depend on how the network interface is configured on your virtual machine. Typical options are NAT or Bridge. In the case of NAT, you need to set up port translation on the virtual machine server. In the case of a bridge, deal with the allocation of IP in your network, it is possible to configure DHCP."
I tried to search in this direction, but I did not find anything useful ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg Benikh, 2018-05-03
@taocs

Found a solution!
It lies in the fact that all requests are received by one of the virtual machines, and from it already distribute requests to the rest - using Nginx.
If anyone is interested, I set up the configuration like this:

server{
  listen 80;
  server_name [ название домена (без квадратных скобок) ];
  location / {
    proxy_pass http://[ IP-адрес виртуалки (без квадратных скобок) ]:80;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
  }
}

M
moropsk, 2018-05-01
@moropsk

Usually, if I'm not mistaken, 1-in domain is equal to 1 IP address.
A crooked solution, to separate domains using different non-standard ports:
site1.ru
site1.ru:81
site3.ru:82
Of course, with https you can do the same, but not the fact that this is correct.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question