diff --git a/rootfs/etc/nginx/template/nginx.tmpl b/rootfs/etc/nginx/template/nginx.tmpl index 381098dbe..5931658a2 100644 --- a/rootfs/etc/nginx/template/nginx.tmpl +++ b/rootfs/etc/nginx/template/nginx.tmpl @@ -1032,8 +1032,10 @@ stream { rewrite_by_lua_block { balancer.rewrite() } + + {{ if shouldConfigureLuaRestyWAF $all.Cfg.DisableLuaRestyWAF $location.LuaRestyWAF.Mode }} + access_by_lua_block { - {{ if shouldConfigureLuaRestyWAF $all.Cfg.DisableLuaRestyWAF $location.LuaRestyWAF.Mode }} local lua_resty_waf = require("resty.waf") local waf = lua_resty_waf:new() @@ -1074,8 +1076,9 @@ stream { {{ end }} waf:exec() - {{ end }} } + {{ end }} + header_filter_by_lua_block { {{ if shouldConfigureLuaRestyWAF $all.Cfg.DisableLuaRestyWAF $location.LuaRestyWAF.Mode }} local lua_resty_waf = require "resty.waf"