You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/26 07:48:22 UTC

[GitHub] [apisix] gxthrj commented on issue #2501: [discuss]: How to distinguish whether the 5xx status code (eg 500) comes from upstream or apisix

gxthrj commented on issue #2501:
URL: https://github.com/apache/apisix/issues/2501#issuecomment-716373824


   I agree with this idea, it will speed up the speed of finding problems out, no need to check the log.
   We can add `x-apisix-upstream-*` in the response header.
   e.g.
   
   When upstream returns 5xx, we get a response like this
   ```
   < HTTP/1.1 5xx *********
   < Date: xxx
   < Content-Type: application/json; charset=UTF-8
   < Connection: keep-alive
   < Server: apisix/1.5.0
   < X-Apisix-Upstream-address: 10.10.10.10:8080
   < Via: apisix/1.5.0
   ```
   When upstream times out, we can get a response like this
   ```
   < HTTP/1.1 504 Gateway Time-out
   < Date: xxx
   < Content-Type: application/json; charset=UTF-8
   < Connection: keep-alive
   < Server: apisix/1.5.0
   < X-Apisix-Upstream-Latency: 30002
   < Via: apisix/1.5.0
   ```


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

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