Introspected Tunnels to Localhost

本地rails服务映射到服务器上,进行外网测试!

ssh -C2qTnN -R 3040:localhost:3000 deploy@xx.xx.xx.xx 本地3000应射到远程服务器3040端口

nginx.conf
1
2
3
4
5
6
7
8
9
10
11
server {
    server_name qt.test.growcn.com;
    underscores_in_headers on;
    location /{
         proxy_pass http://127.0.0.1:3040/;
         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;
    }
}

补充:

这个方案也不错https://ngrok.com/

原文地址:http://dlj.bz/tG4SoL

Comments