前言
我们有服务部署在我们内网服务,需要暴露给合作方演示这种服务。之前找了
open-dingtalk 找了挺多配置没有发现关于做除了127.0.0.1 之外域名做转发, nginx 能够很好对域名进行转发。
实践
http://nginx.org/en/download.html nginx下载
修改nginx.conf 配置
监听9999 端口 和 localhost,127.0.0.1 域名
转发到 http://xxxxx:xxx 目标路由
server {
listen 9999;
server_name localhost,127.0.0.1;
location /{
proxy_pass http://xxxxx:xxx;
proxy_redirect default;
}
}
进入nginx.exe 双击启动,进入nginx.exe 界面中加载配置
直接用http:127.0.0.1:9999/uri 测试是否能够访问目标网址,测试成功之后。下载open-dingtalk 进行内网穿透。
https://github.com/open-dingtalk/pierced open-dingtalk下载
进入到ding.exe 页面中执行
ding.exe -config=./ding.cfg -subdomain=hursa_test 9999
连接成功,这个时候我们
https://hursa_test.vaiwan.com/xxx/xxx 进入到对应的页面