已经写过一个openresty 使用lua-resty-shell 执行shell 脚本的demo,但是实际上我们可能是多节点运行, 同时需要负载均衡的机制。 lua-resty-shell 支持unix socket 以及tcp soket 的管理,但是在测试的时候发现tcp 有问题,所以只好 使 ...
分类:
系统相关 时间:
2018-12-07 11:51:33
阅读次数:
306
lapis 是基于openresty 扩展的,所以直接将支持prometheus的模块构建进openresty 就可以了 我使用的是nginx-module-vts 模块 环境准备 我已经构建好了支持的基础镜像,可以直接配置即可,具体的可以看下面的参考资料 docker-compose 文件 ver ...
一、安装OpenResty Linux官方建议直接通过官方提供的预编译包安装:http://openresty.org/cn/linux-packages.html openresty默认安装在/usr/local/openresty,其中已自带nginx。 二、使用安全规则ngx_lua_waf ...
分类:
其他好文 时间:
2018-11-23 20:58:58
阅读次数:
272
安装第三方模块echo-nginx-modulegitclonehttps://github.com/openresty/echo-nginx-module.git./configure--add-module=/nginx安装目录/echo-nginx-modulemake&&makeinstall安装之后,可以直接在配置文件中使用echo‘‘命令location
分类:
其他好文 时间:
2018-11-12 19:48:47
阅读次数:
492
graphql 是一个很不错的api 查询标准语言,已经有一个lua 的版本支持graphql 项目使用docker&&docker-compose 运行 环境准备 模块安装 luarocks install graphql docker镜像准备 模块使用luarocks 安装,默认alpine 镜 ...
1、需要的安装包下载mkdir-p/home/toolscd/home/tools/wgethttp://luajit.org/download/LuaJIT-2.0.2.tar.gzwgethttps://github.com/openresty/lua-nginx-module/archive/v0.10.9rc7.tar.gzwgethttps://github.com/simpl/ngx_
分类:
其他好文 时间:
2018-11-11 23:28:21
阅读次数:
237
一、架构 环境: 192.168.189.131:tomcat服务 192.168.189.132:tomcat服务 192.168.189.130:OpenResty服务、redis服务 流程: 请求到达openresty,openresty从redis获取白名单,然后判断请求地址是否再白名单,在 ...
分类:
其他好文 时间:
2018-11-11 10:31:29
阅读次数:
286
1、新增项目配置文件: 2、编写lua脚本(获取http请求信息) 3、检查配置文件是否正确 4、重启openresty 5、测试: 浏览器访问:http://127.0.0.1/lll/lua_request/1/5/2?a=3&b=4 由于通过浏览器请求方式为get方式 ,所以post处没有打印 ...
分类:
其他好文 时间:
2018-11-10 15:26:48
阅读次数:
152
Name: openresty Version: 1.13.6.1 Release: 2%{?dist} Summary: OpenResty, scalable web platform by extending NGINX with Lua Group: System Environment/D... ...
分类:
其他好文 时间:
2018-11-03 11:16:17
阅读次数:
141
local permission = MatchUrlTree(ngx.var.uri,ngx.req.get_method()) if permission then local permission_json,err =redis_sess:get(permission_key) if perm... ...