You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "zccabb (via GitHub)" <gi...@apache.org> on 2023/04/20 09:39:24 UTC

[GitHub] [apisix] zccabb commented on issue #9342: where to find 404 config

zccabb commented on issue #9342:
URL: https://github.com/apache/apisix/issues/9342#issuecomment-1516026787

   Do you mean that you want to customize the return of 404?
   If so, you can find the information for 404 under apisix/init.lua.Change it to the value you want.
   https://github.com/apache/apisix/blob/54159168ee52f9d8614b6706842ddc5e5af2c4fb/apisix/init.lua#L569-L576
   ### Example
   ```lua
   return core.response.exit(404,
                       {error_msg = "404 Route Not Found TEST TEST"})
   ```
   If a 404 error occurs:
   ```shell
   $ ~ curl 127.0.0.1:9080/
   {"error_msg":"404 Route Not Found TEST TEST"}
   ```


-- 
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: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org