qq54903099 opened a new issue #5376:
URL: https://github.com/apache/apisix/issues/5376


   ### Issue description
   
   http-log内容中如何区分是上游返回的错误码,还是apisix返回的错误码。
   
   我测试了两种情况,这一种是调用路由未传递授权信息,返回的状态码为401
   > "response":
           {
               "status": 401,
               "headers":
               {
                   "x-request-id": "8942b7d6-a0a5-4cab-8dde-d09f80d144ec",
                   "transfer-encoding": "chunked",
                   "server": "APISIX",
                   "content-type": "text/plain; charset=utf-8",
                   "connection": "close"
               },
               "size": 280
           },
   
   这个是上游返回的401
   > "response":
           {
               "status": 401,
               "headers":
               {
                   "report-to": "{\"endpoints\":
                   
[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=m3zBHUeAq%2FCMTZmPTMVJcjuWvV3WTvEhTfdy54CRtdhX11Y9UPjf9xjfSThBue%2FHsUjwgiccigR86FEeNOb7ciAhG9oZvANirZmWhESF3MxYQXprg8XslhBTmN9C7Q%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}",
                   "nel": 
"{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}",
                   "cf-ray": "6a6283167c160d58-LAX",
                   "server": "APISIX",
                   "alt-svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, 
h3-28=\":443\"; ma=86400, h3-27=\":443\"; ma=86400",
                   "content-length": "0",
                   "x-request-id": "3d59e960-82e3-4bf0-8eca-f87130875986",
                   "date": "Sat, 30 Oct 2021 06:15:57 GMT",
                   "via": "1.1 vegur",
                   "cf-cache-status": "DYNAMIC",
                   "etag": "W/\"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk\"",
                   "connection": "close"
               },
               "size": 708
           },
   
   
   有没有什么办法能够区分?
   
   ### Environment
   
   - apisix version (cmd: `apisix version`): 2.10.0
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `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