It is possible to arrange this through a proxy. I have a WireGuard that has the internal IP address of the participants.
Let's take an example from a server that connected VPN with IP address: 10.8.0.2 (internal IP address)
VPN IP address: 10.8.0.2
You need to install on your vps a vpn which creates a local network.
I have wireguard.
Then set nginx as proxy.
once installed, open a browser and enter the IP address of your vps.
If the nginx greeting opens.
This is good.
It should work something like this: a request comes to vps, nginx processes it and sends information to the connected server via vpn (WireGuard), waits for a response and sends it back to who sent the request.
It remains to fix the config.
vpn nginx config
enter code here
server {
client_body_timeout 5s;
client_header_timeout 5s;
listen 80; #port
server_name 2.16.136.1;# domen/ip vpn
add_header Access-Control-Allow-Origin *;
location / {
#limit_conn addr 3;
limit_rate 71680k;
#if ($http_cookie ~* ".+" ) {
#set $cookie_cache_bypass 1;
#}
proxy_pass http://10.8.0.2:5000;
proxy_read_timeout 300;
proxy_connect_timeout 300;
proxy_redirect off;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_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-Ssl on;
proxy_set_header X-Frame-Options SAMEORIGIN;
proxy_cache all;
proxy_cache_valid 404 502 503 20m;
proxy_cache_valid any 2h;
proxy_cache_use_stale error timeout invalid_header updating;
gzip on;
gzip_disable "msie6";
gzip_vary on;
#gzip_proxied any;
gzip_comp_level 5;
gzip_min_length 2240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
}
}
PS: sorry for config typos if there are any.