The last request before this 502 request is almost 20 minutes ago and its 
response code is 200.

The proxy_next_upstream conf:
    proxy_next_upstream error timeout invalid_header http_502 http_503 http_504;

Here is the access log. The upstream server 192.168.0.6 is DOWN. The line-10 is 
the 502 request:

  1 [03/May/2017:14:35:38 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.6:8181, 
192.168.0.5:8181" 0.012 0.001, 0.011
  2 [03/May/2017:14:35:38 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.013 0.013
  3 [03/May/2017:14:54:30 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.206 0.206
  4 [03/May/2017:15:03:08 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.154 0.154
  5 [03/May/2017:15:40:51 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.6:8181, 
192.168.0.5:8181" 0.012 0.000, 0.012
  6 [03/May/2017:15:40:51 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.014 0.014
  7 [03/May/2017:15:40:51 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.016 0.016
  8 [03/May/2017:15:40:51 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.017 0.017
  9 [03/May/2017:15:40:51 -0400] "POST /x/y HTTP/1.1" 200  "192.168.0.5:8181" 
0.011 0.011
 10 [03/May/2017:15:59:06 -0400] "POST /x/y HTTP/1.1" 502  "192.168.0.6:8181, 
test_backend" 0.000 0.000, 0.000
 11 [03/May/2017:15:59:07 -0400] "POST /x/y HTTP/1.1" 200  
"10.255.222.206:8181" 0.260 0.260



At 2017-05-10 22:43:07, "Maxim Dounin" <[email protected]> wrote:
>Hello!
>
>On Wed, May 10, 2017 at 10:27:16PM +0800, Wu Bingzheng wrote:
>
>> Maybe you miss something in Question 2. The server 192.168.0.5 never fails.
>> I think nginx should not return 502 if there is at least one server never 
>> fails.
>> Exactly speaking, the server never fails in the last 1 hour and the 
>> fail_timeout is the default 10 second.
>
>How do you know that the server never fails?
>
>The "no live upstreams" error indicate that it failed from nginx 
>point of view, and was considered unavailable.
>
>Note that "failure" might not be something specifically logged by 
>nginx, but a response with a specific http code you've configured 
>in proxy_next_upstream, see http://nginx.org/r/proxy_next_upstream.
>
>-- 
>Maxim Dounin
>http://nginx.org/
>_______________________________________________
>nginx mailing list
>[email protected]
>http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to