From fcc2f276c7ffcab59e4b0c72ecc4a6eb6e2c93b0 Mon Sep 17 00:00:00 2001 From: he liu Date: Fri, 1 Feb 2019 02:05:25 +0800 Subject: [PATCH] =?UTF-8?q?Updated=20=E4=BD=BF=E7=94=A8=E6=95=99=E7=A8=8B?= =?UTF-8?q?=20(markdown)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 使用教程.md | 91 +------------------------------------------------ 1 file changed, 1 insertion(+), 90 deletions(-) diff --git a/使用教程.md b/使用教程.md index c7126c3..945c9b4 100644 --- a/使用教程.md +++ b/使用教程.md @@ -1,90 +1 @@ -## 基础设施 -- 一个域名 -- 一台公网服务器(腾讯云、阿里云) -- 一台内网服务器(自己电脑或者其他) - -## 教程 -1. 域名配置 - -添加两条解析记录 -> -server A 123.206.77.88 - -> *.server CNAME server.ourcauc.com. - -项目 | 说明 ----|--- -server | 二级域名 -ourcacu.com | 域名 -server、*.server | 解析记录 -A、CNAME | 记录类型 -123.206.77.88 | 服务器ip地址 - -2. 服务器配置 -- 安装nginx(较为简单,不再说明) -- 添加nginx服务器配置,配置如下,server_name请根据自己的实际情况修改 -``` -upstream nodejs { - server 127.0.0.1:8024; - keepalive 64; -} -server { - listen 80; - server_name *.server.ourcauc.com; - 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:8024; - proxy_set_header X-Nginx-Proxy true; - proxy_set_header Connection ""; - proxy_pass http://nodejs; - } -} -``` -3. 在服务端启动easyProxy - -``` -./easyProxy -mode server -vkey DKibZF5TXvic1g3kY -tcpport=8284 -httpport=8024 -``` - -4. 在客户端建立配置文件,示例如下 - -``` -{ - "Server": { - "ip": "123.206.77.88", - "tcp": 8284, - "vkey": "DKibZF5TXvic1g3kY", - "num": 10 - }, - "SiteList": [ - { - "host": "a.server.ourcauc.com", - "url": "10.1.50.203", - "port": 80 - }, - { - "host": "b.server.ourcauc.com", - "url": "10.1.50.196", - "port": 4000 - } - ], - "Replace": 0 -} -``` -前面已经有说明 - -最后的效果, - -访问a.server.ourcauc.com相当于访问10.1.50.203:80 - -访问b.server.ourcauc.com相当于访问10.1.50.196:4000 - -支持多站点 - -5. 客户端启动 - - -``` -./easyProxy -config config.json -``` - +. \ No newline at end of file