Nginx shows 2 different statuses in the upstream response log Nginx shows 2 different statuses in the upstream response log nginx nginx

Nginx shows 2 different statuses in the upstream response log


According to split_upstream_var method of ingress-nginx, it splits results of nginx health checks.

Since nginx can have several upstreams, your log could be interpreted this way:

  1. First upstream is dead (504)
upstream_response_length: 0 // responce from dead upstream has zero lengthupstream_response_time: 60.000 // nginx dropped connection after 60secupstream_status: 504 // responce code, upstream doesn't answer
  1. Second upstream works (200)
upstream_response_length: 840 // healthy upstream returned 840b upstream_response_time: 0.760 // healthy upstream responced in 0.760upstream_status: 200 // responce code, upstream is ok

P.S. JFYI, here's a cool HTTP headers state diagram

Http-headers-status