OpenResty 自动降级限流:
OpenResty1.13.6.1版本自带lua-resty-limit-traffic模块 ,只要是openresty版本号大于1.13.6.1的,都是默认自带lua-resty-limit-traffic模块的。
如果,OpenResty版本低于1.13.6.1 ,则需要下载限流模块,下面是下载地址:
git clone https://github.com/openresty/lua-resty-limit-traffic.git
nginx配置:
1.http内配置共享内存 名为my_limit_req_store,引入对应包
http {
include mime.types;
default_type application/octet-stream;
lua_package_path "/usr/html/lua-resty-limit-traffic-master/lib/resty/limit/?.lua;;";
lua_shared_dic