ngrok使用nginx实现80端口代理

nginx配置如下:

upstream ngrok {  
    server 127.0.0.1:8810; # 此处端口要跟 启动服务端ngrok时指定的端口一致
    keepalive 64;
}
server {  
    listen       80;
    server_name  *.ngrok.test.com;
    #charset koi8-r;

    location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host  $http_host:8810; #此处端口要跟 启动服务端ngrok 时指定的端口一致
            proxy_set_header X-Nginx-Proxy true;
            proxy_set_header Connection "";
            proxy_pass      http://ngrok;
    }
}

大前端知识库收集分享 www.rjxgc.com 壹玖零Tech
搜罗各种前后端奇淫技巧,花式编程思想,日日更新,速来围观吧...

引用链接:http://www.wxapp-union.com/portal.php?mod=view&aid=1148

你可能感兴趣的:(ngrok使用nginx实现80端口代理)