Answer the question
In order to leave comments, you need to log in
Home server: 1 Public IP -> several virtual machines
Good afternoon!
The situation is as follows: There is a GPON Internet with Public IP 1.2.3.4 and, for example, a home server with an internal IP of 192.168.1.101. In the router settings, I specify port forwarding 22, 80, 8080 to the corresponding ports 192.168.1.101. There is a KVM on machine 192.168.1.101, for example, with three virtual machines looking into the network through its own NAT, for example, with IP 192.168.100.101, 192.168.100.102, 192.168.100.103 .. Here the question arises, as already from machine 192.168. 1.101 do a redirect(?) to virtual machines, depending on which host was accessed and at the same time it was all visible via the Internet?
Those. I just type, for example, somehost.example.com, which looks in DNS A-record in IP 1.2.3.4, then the router sends this request to the machine 192.168.1.101 in its local network, the machine 192.168.1.101 looks which host is from it want and sends the request further, for example, to the machine 192.168.100.102.
Answer the question
In order to leave comments, you need to log in
server {
server_name somehost.example.com;
listen 80;
location / {
proxy_pass http://192.168.0.100;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
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