Answer the question
In order to leave comments, you need to log in
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
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;
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question