demo conf

This commit is contained in:
zjcqoo 2019-05-31 11:26:44 +08:00
parent 0f3f856506
commit 6b06f808c6
4 changed files with 33 additions and 4 deletions

View File

@ -10,11 +10,13 @@ http://127.0.0.1:8080 '127';
http://localhost 'lo';
http://localhost:8080 'lo';
https://jsproxy.tk 'js-tk';
# 接口和网站同源,这种情况下 origin 为空
'' 'mysite';
# ~ 开头为正则匹配,此处允许 github.io 所有子站点
~^https://([\w-]+)\.github\.io$ 'gh-$1';
~^https://([\w-]+)\.github\.io$ 'gh-$1';
# 允许任何站点使用
# ~(.*) '$1';

View File

@ -0,0 +1,3 @@
listen 8443 ssl http2;
ssl_certificate cert/etherdream.com/ecc.cer;
ssl_certificate_key cert/etherdream.com/ecc.key;

View File

@ -111,9 +111,9 @@ local function nodeSwitched()
end
-- 节点切换功能目前还在测试中demo 中已开启)
-- if nodeSwitched() then
-- return
-- end
if nodeSwitched() then
return
end
local h, err = ngx.resp.get_headers()

24
upload.sh Executable file
View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# 功能:同步文件到所有节点,并重启服务
HOST=etherdream.com
NODE=(
aliyun-hk-2
# aliyun-hk-0
# aliyun-hk-1
# aliyun-sg
)
for v in ${NODE[@]}; do
echo "$v upload ..."
rsync . jsproxy@$v.$HOST:server \
-a \
--exclude='nginx/cache/*' \
--exclude='nginx/logs/*'
echo "$v restart ..."
ssh jsproxy@$v.$HOST "./server/run.sh reload"
done
echo "done"