From 42ab1e3f27debe7a85456d38d7870e7d4c777831 Mon Sep 17 00:00:00 2001 From: cnlh <40694320+cnlh@users.noreply.github.com> Date: Sun, 4 Nov 2018 23:08:27 +0800 Subject: [PATCH] Initial Home page --- 使用教程.md | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 使用教程.md diff --git a/使用教程.md b/使用教程.md new file mode 100644 index 0000000..fcbfb5b --- /dev/null +++ b/使用教程.md @@ -0,0 +1,81 @@ +## 基础设施 +- 一个域名 +- 一台公网服务器(腾讯云、阿里云) +- 一台内网服务器(自己电脑或者其他) + +## 教程 +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:8224; + proxy_set_header X-Nginx-Proxy true; + proxy_set_header Connection ""; + proxy_pass http://nodejs; + } +} +``` +3. 在服务端启动easyProxy + +``` +./rproxy -mode server -vkey DKibZF5TXvic1g3kY -tcpport=8284 -httpport=8024 +``` + +4. 在客户端建立配置文件,示例如下 + +``` +{ + "Server": { + "ip": "123.206.77.88", + "tcp": 8224, + "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 + } + ] +} +``` +前面已经有说明 + +最后的效果, + +访问a.server.ourcauc.com相当于访问10.1.50.203:80 + +访问b.server.ourcauc.com相当于访问10.1.50.196:4000 + +支持多站点