xx-zhang opened a new issue, #11815:
URL: https://github.com/apache/apisix/issues/11815

   ### Description
   
   How to make request-uuid to responseBody 
   
![image](https://github.com/user-attachments/assets/69b4e853-7193-41e4-bb19-f5985222656f)
   
   i have tried plugin to custom-page-403 , but no use, then no response. 
   
   ```lua
   local core = require("apisix.core")
   
   local plugin_name = "page-403"
   
   local schema = {
       type = "object",
       properties = {},
   }
   
   local _M = {
       version = 0.1,
       priority = 0,
       name = plugin_name,
       schema = schema,
   }
   
   function _M.access(conf, ctx)
       -- 这里可以添加逻辑来判断是否需要返回403错误
   end
   
   function _M.header_filter(conf, ctx)
       if ngx.status == 403 then
           local uuid = ngx.header["x-coraza-uuid"] or "-"
           ngx.header.content_type = "text/html"
           ngx.say("<html><body><h1>403 Forbidden</h1><p>Your UUID: " .. uuid 
.. "</p></body></html>")
           ngx.exit(403)
       end
   end
   
   return _M
   ```
   
   ### Environment
   
   - APISIX version (run `apisix version`): 3.11 (latest)
   - Operating system (run `uname -a`): debian:12 
   - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): 1.27.1 
   - etcd version, if relevant (run `curl 
http://127.0.0.1:9090/v1/server_info`): docker-apisix example version 
   - APISIX Dashboard version, if relevant: 
   - Plugin runner version, for issues related to plugin runners:
   - LuaRocks version, for installation issues (run `luarocks --version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to