使用阿里雲ECS伺服器轉發外網請求到內網(微信公眾號開發本地除錯環境)
阿新 • • 發佈:2019-01-21
1. 獲得阿里雲ECS伺服器的ip 139.224.12.182
2. 配置微信公眾號事件推送的地址, http://139.224.12.182/project/index.htm
3. 配置阿里雲伺服器, 使用nginx轉發所有80埠的請求
server {
listen 80;
server_name localhost80;
charset utf-8;
location / {
proxy_pass http://225.129.224.167:8080;
}
}
其中225.129.224.167為本地網路的出口ip
4. 配置本地網路的路由器, 增加虛擬機器伺服器轉發請求到內網某臺電腦上
5. 配置完成, 訪問
http://139.224.12.182/project/index.htm 等同於訪問
http://192.168.1.254:8080/project/index.htm