S
S
Sharov Dmitry2015-02-04 08:45:57
Debian
Sharov Dmitry, 2015-02-04 08:45:57

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

3 answer(s)
S
Salavat Sharapov, 2015-02-04
@desperadik

You can put a web server ahead of everything with proxying.

A
Archie Kuznetsov, 2015-02-04
@Wolf4ara

Proxy through nginx. Delov for a couple of lines then =)

S
Santa Claus16, 2015-09-14
@Santa Claus16

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 question

Ask a Question

731 491 924 answers to any question