B.R.
August 21, 2016 10:10AM
As per the docs
<http://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_status>,
it is said this variable contains all the status codes returned by each
upstream interrogated.
From what I understood, server1 returned 504, server2 returned 502.

Those statuses are included in what the proxy_next_upstream
<http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream>
directive describes as an 'unsuccessful attempt', thus it seems every
server of your upstream group has been tried (default number of attempts is
1 as per the server
<http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server>
directive).
nginx then returned the result of the last attempt, resulting in a 502
answer passed back to the client.

I do not know what a 'special response' is. Custom header?
I also do not get why you are surprised by the fact 5xx responses end up
with them being shown to client. They are perfectly valid HTTP status
codes, indicating a server error, and are shown because no upstream server
returned a 'successful' status code.
---
*B. R.*

On Fri, Aug 19, 2016 at 9:54 PM, Frank Liu <gfrankliu@gmail.com> wrote:

> Hi,
>
> I am using nginx as proxy with two upstream servers. In the access log, I
> log the upstream_address, upstream_status, status (downstream), a special
> response header from upstream, etc.
>
> A few times I see in the log upstream_address: server1:port, server2:port
> with upstream_status: 504, 502 status: 502 special header: -
> Since there is the special response header, I assume nginx didn't get any
> responses from either upstream servers. Why would upstream_status shows 504
> and 502? Those code must not come from upstream, is it generated by nginx
> self? I thought it would be -, - since there are no upstream_status
> returned from upstream.
>
> Thanks!
> Frank
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

upstream status

Frank Liu August 19, 2016 04:06PM

Re: upstream status

B.R. August 21, 2016 10:10AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 202
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready