ingress-nginx-helm/rootfs/etc/nginx/lua/plugins/hello_world/main.lua

16 lines
207 B
Lua
Raw Normal View History

2019-02-25 02:32:17 +00:00
local _M = {}
function _M.rewrite()
ngx.req.set_header("x-hello-world", "1")
end
function _M.access()
local ua = ngx.var.http_user_agent
if ua == "hello" then
ngx.exit(403)
end
end
return _M