mirror of
https://github.com/ehang-io/nps.git
synced 2025-09-01 02:46:52 +00:00
update docs, close #424
This commit is contained in:
@@ -14,6 +14,8 @@
|
||||
|
||||
**适用范围:** 小程序开发、微信公众号开发、产品演示
|
||||
|
||||
**注意:域名解析模式为http反向代理,不是dns服务器,在web上能够轻松灵活配置**
|
||||
|
||||
**假设场景:**
|
||||
- 有一个域名proxy.com,有一台公网机器ip为1.1.1.1
|
||||
- 两个内网开发站点127.0.0.1:81,127.0.0.1:82
|
||||
@@ -77,6 +79,8 @@
|
||||
- 在刚才创建的客户端隧道管理中添加一条http代理,填写监听的端口(8004),保存。
|
||||
- 在外网环境的本机配置http代理,ip为公网服务器ip(1.1.1.1),端口为填写的监听端口(8004),即可访问了
|
||||
|
||||
**注意:对于私密代理与p2p,除了统一配置的客户端和服务端,还需要一个客户端作为访问端提供一个端口来访问**
|
||||
|
||||
## 私密代理
|
||||
|
||||
**适用范围:** 无需占用多余的端口、安全性要求较高可以防止其他人连接的tcp服务,例如ssh。
|
||||
@@ -95,7 +99,7 @@
|
||||
|
||||
**注意:** password为web管理上添加的唯一密钥,具体命令可查看web管理上的命令提示
|
||||
|
||||
假设10.1.50.2用户名为root,现在执行`ssh -p 2000 root@1.1.1.1`即可访问ssh
|
||||
假设10.1.50.2用户名为root,现在执行`ssh -p 2000 root@127.0.0.1`即可访问ssh
|
||||
|
||||
|
||||
## p2p服务
|
||||
|
@@ -14,18 +14,18 @@
|
||||
|
||||
## 与nginx配合
|
||||
|
||||
有时候我们还需要在云服务器上运行nginx来保证静态文件缓存等,本代理可和nginx配合使用,在配置文件中将httpProxyPort设置为非80端口,并在nginx中配置代理,例如httpProxyPort为8024时
|
||||
有时候我们还需要在云服务器上运行nginx来保证静态文件缓存等,本代理可和nginx配合使用,在配置文件中将httpProxyPort设置为非80端口,并在nginx中配置代理,例如httpProxyPort为8010时
|
||||
```
|
||||
server {
|
||||
listen 80;
|
||||
server_name *.proxy.com;
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_pass http://127.0.0.1:8024;
|
||||
proxy_pass http://127.0.0.1:8010;
|
||||
}
|
||||
}
|
||||
```
|
||||
如需使用https也可在nginx监听443端口并配置ssl,并将本代理的httpsProxyPort设置为空关闭https即可,例如httpProxyPort为8024时
|
||||
如需使用https也可在nginx监听443端口并配置ssl,并将本代理的httpsProxyPort设置为空关闭https即可,例如httpProxyPort为8020时
|
||||
|
||||
```
|
||||
server {
|
||||
@@ -40,7 +40,7 @@ server {
|
||||
ssl_prefer_server_ciphers on;
|
||||
location / {
|
||||
proxy_set_header Host $http_host;
|
||||
proxy_pass http://127.0.0.1:8024;
|
||||
proxy_pass http://127.0.0.1:8020;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user