server {
server_name ivan;
listen 8080;
location / {
rewrite_by_lua_block{
local data = ""> ngx.say("data : ")
for _,v in pairs(ngx.shared.data:get_keys()) do
ngx.say(v.." : "..ngx.shared.data:get(v))
end
}
location /clear/ {
rewrite_by_lua_block{
local data = ""> data.flush_all()
}
}
}
after curl http://localhost:8086/clear/ i expect that all keys were expired, but in my nginx error log i see the error:
2016/12/12 13:07:27 [error] 7198#0: *6 lua entry thread aborted: runtime error: rewrite_by_lua(common.conf:52):3: expecting 1 argument, but seen 0
stack traceback:
coroutine 0:
[C]: in function 'flush_all'
rewrite_by_lua(common.conf:52):3: in function <rewrite_by_lua(common.conf:52):1>, client: 127.0.0.1, server: ivan, request: "GET /clear/ HTTP/1.1", host: "localhost:8080"
in documentation flush_all use without arguments.