java nginx 配置文件
说明
这些文件需要
copy
到openresty
的home
目录
IP block endpoints
-
Remove blocked ip
: http://erp.yoho.yohoops.org/malIp?method=pubDel&ips=1.2.3.4,1.2.3.5 -
Add to block ip
: http://erp.yoho.yohoops.org/malIp?method=pubAdd&ips=1.2.3.4,1.2.3.5&expire=110000 -
Remove all block ip
: http://erp.yoho.yohoops.org/malIp?method=flushAll -
Retrive all block ip
: http://erp.yoho.yohoops.org/malIp?method=queryAll
切换
-
重置
: http://erp.yoho.yohoops.org/switch?method=reset -
查询
: http://erp.yoho.yohoops.org/switch?method=query -
设置UID强制到aws
: http://erp.yoho.yohoops.org/switch?method=force&uid=50873076 -
设置按照比率切换到aws
: http://erp.yoho.yohoops.org/switch?method=switch&percentage=10
短链接服务
生成短链接 (限制内网访问)
curl -X POST -d "uri=http://www.yoho.cn" "http://yhurl.com/gs"
响应: 注意需要处理转义字符
{"code":200,"uri":"http:\/\/yhurl.com\/1THVRTV"}
upstream
的支持
动态基于 lua-upstream-nginx-module 动态设置upstream的 up
, down
- 查询所有的
upstreams
信息:
curl -i -H "Host: erp.yoho.yohoops.org" "http://127.0.0.1/upstreams?method=list&upstream=apigateway"
- 设置
upstream
名称为apigateway
的upstream
第0个backend server
状态为down
:
curl -i -H "Host: erp.yoho.yohoops.org" "http://127.0.0.1/upstreams?method=down&upstream=apigateway&id=0"
- 设置
upstream
名称为apigateway
的upstream
第0个backend server
状态为up
:
curl -i -H "Host: erp.yoho.yohoops.org" "http://127.0.0.1/upstreams?method=up&upstream=apigateway&id=0"
list 接口响应:
{
"name": "apigateway",
"value": [
{
"backup": false,
"name": "172.31.70.77:8080",
"down": false,
"id": 0
},
{
"backup": false,
"name": "172.31.70.113:8080",
"down": false,
"id": 1
},
{
"backup": false,
"name": "172.31.70.8:8080",
"down": false,
"id": 2
},
{
"backup": false,
"name": "172.31.70.104:8080",
"down": false,
"id": 3
}
]
}