nanamikon commented on issue #8628:
URL: https://github.com/apache/apisix/issues/8628#issuecomment-2078818222

   error_page may not work if we use ngx.print or ngx.say,  see 
https://github.com/openresty/lua-nginx-module/issues/1541
   
   For example,   when route not found ,  core.response.exit with message will 
call ngx.print,  in this case, error_page will not work.
   ```
       ----- /apisix/init.lua
   
       local route = api_ctx.matched_route
       if not route then
           -- run global rule when there is no matching route
           local global_rules = apisix_global_rules.global_rules()
           plugin.run_global_rules(api_ctx, global_rules, nil)
   
           core.log.info("not find any matched route")
           return core.response.exit(404,
                       {error_msg = "404 Route Not Found"})
       end
   ```


-- 
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