sh
content_by_lua_file /script/sc.lua;
default_type text/html;
default_type application/json;
content_by_lua_file /script/sc.lua;
## nginx lua
local redis = require "resty.redis"
local red = redis:new()
red:set_timeouts(1000, 1000, 1000) -- 1 sec
red:connect("127.0.0.1", 6379,{
pool_size=10
}
)
red:set_keepalive(1000, 10)
local ip = ngx.var.remote_addr
~= !=