💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
## 实例讲解 先看一个配置的示例 ![](https://img.kancloud.cn/50/a0/50a01d71138cbc4304620db8eb3ddef7_741x461.png) ``` { "des": "2-func", "uri": [ "/api/test/debug", "" ], "state": "on", "hostname": [ "localhost5460", "" ], "replace_list": [ [ "replace_hello", "func", { "len": 4, "description": "参数使用demo" } ] ] } ``` * host 匹配域名等于`localhost5460` `localhost5460` 这个表示的是WAF服务器的web管理后台的服务 * uri 匹配`uri`正则匹配 `^/api/ip_dict$` * 替换规则 调用插件函数名称为:replace_hello,传递给插件的参数是:`{ "len": 4, "description": "参数使用demo" }` 插件的内容: ``` local _M = { _VERSION = "0.01" } local function replace_hello(str_all , _tb_args) -- 这里可以使用函数完成你想要的替换结果 return ngx.re.gsub(str_all, "hello", "HELLO") end _M.replace_hello = replace_hello return _M ```