Answer the question
In order to leave comments, you need to log in
Forward ports for a site on a virtual machine?
The situation is this.
We have a dedicated server. It has 2 virtual machines. On one, all sites to which port 80 is transferred. And on the second there will be only one site, with specific settings. But how to forward ports so that when this site is requested, a request would be made to the second virtual machine?
UPD: There is only one external ip
Answer the question
In order to leave comments, you need to log in
You can put a web server ahead of everything with proxying.
We put nginx on any machine, add 2 configs:
#server1
server {
listen 80;
server_name server1.domain.name;
location / {
# pass the hostname to the remote server
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://10.10.10.1;
}
}
And the second config by analogy.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question