摘要: set.lua 根据业务逻辑 返回nginx.conf里定义的负载均衡 upstream方式名称 return "upstream_server_hash" nginx.conf upstream upstream_server_hash { } upstream upstream_server_r 阅读全文
posted @ 2019-11-27 15:03 马户 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 下载 nginx-upsync-module wget https://github.com/weibocom/nginx-upsync-module/archive/v2.1.0.tar.gz 重新编译nginx --add-module=/root/sortware/nginx-upsync-m 阅读全文
posted @ 2019-11-11 13:24 马户 阅读(958) 评论(0) 推荐(0) 编辑
摘要: #根据ip地址返回0,1,2等 本例0为白名单 上下文 http geo $rule_list { default 1; 127.0.0.1 1; 112.81.16.62 0; #include ip文件 } #如果不在条件之内返回二进制地址 上下文 http map $rule_list $li 阅读全文
posted @ 2019-11-07 15:37 马户 阅读(887) 评论(0) 推荐(0) 编辑
摘要: function array2tree($data, $pId) { $tree = array(); foreach($data as $k => $v) { if ($v['father_id'] == $pId) { $v['child'] = array2tree($data, $v['or 阅读全文
posted @ 2019-08-19 17:01 马户 阅读(122) 评论(0) 推荐(0) 编辑