服务器
转发http 标签描述

微信小程序和公众号,要求外链的页面或API必须使用https。https意味着需要证书,在测试阶段,很不方便,因此部署的测试站点都是http。于是尝试在现有的https站点中,用nginx转发请求到只有http的测试站点。 方法众所周知,在nginx.conf中添加一个转发规则。 {listen80;server_name服务器IP;。。。}server{listen443ssl;server_name服务器IP;。。。location/test/{注意一定要以“/”结尾,否则/test/一律跳到/testproxy_passhttp://测试的HTTP站点IP:端口/;proxy_r...