L
L
Lev Fedorov2020-03-01 19:28:14
VPN
Lev Fedorov, 2020-03-01 19:28:14

How to forward ports in VPN on another PC?

There is
a Server on Windows Server 2016 Core with a white IP on which a DNS record was created in Cloudflare . WireGuard is hosted
on the same server and another PC with a gray IP address is connected through the tunnel.
The PC has OpenServer installed with the website.
It is necessary that when accessing the domain, the user receives a site hosted on a PC.

I tried forwarding port 80 from the server to the IP address of the computer in the VPN, it did not work

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey V, 2020-03-01
@dthpth

as an option, using the reverse proxy installed on the win server,
for example, nginx config
example:

http {

    server {
        listen 80;
        server_name my-public-domain.com;
        location / {
            proxy_pass http://192.168.1.123:8080/;
            include proxy.conf;
        }
    }

}

proxy.conf:
proxy_redirect          off;
proxy_set_header        Host            $host;
proxy_set_header        X-Real-IP       $remote_addr;
proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header        X-Forwarded-Proto $scheme;
client_max_body_size    1024m;
client_body_buffer_size 128k;
proxy_connect_timeout   900;
proxy_send_timeout      900;
proxy_read_timeout      900;
proxy_buffers           32 4k;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question