External network access test machine.
The Windows machine uses SSH to reverse tunnel. Service side using reverse proxy
Install Openssh-win and set environment variables under win
Open cmd
C:\users\administrator>ssh-p 22-r 1999:localhost:8080-b 0.0.0.0 [email protected]
-R 1999 Port of the remote machine
-B External network segment monitoring, no 127.0.0.1 monitoring
8080 Native port
This way, the 1999 port of the extranet access 8.8.8.8 maps to LocalHost's 8080
Server Nginx Reverse Proxy
VI nginx.conf
Upstream Dev {
Server 127.0.0.1:1999;
}
server {
Listen 80;
server_name dev.xx.com;
Location/{
Proxy_pass Http://dev;
}
Proxy_ignore_client_abort on;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
}
4. dev.xx.com can access to localhost:8080
This article is from the "Quest" blog, please be sure to keep this source http://chenxy.blog.51cto.com/729966/1890459
Intranet interface call, SSH reverse tunnel and Nginx reverse proxy