For enabling security in ES i used Nginx with Lua and got some sample code from github . In that i am not clear at some part of code.
for path, methods in pairs(restrictions[role]) do
-- path matched rules?
local p = string.match(uri, path)
//here p contains "get"
-- method matched rules?
local m = nil
for _, _method in pairs(methods) do
m = m and m or string.match(method, _method)
// what does this step will do?
if p and m then
allowed = true
if not allowed then
Correct me if i am wrong..
Any help is highly appreciated..