stream, it always aborts the first server in upstream

itpp2012 nginx-forum at
Mon Oct 5 12:20:03 UTC 2015

A strange 'bug' in stream, it always aborts the first server in upstream
eventhough there is nothing wrong with the server.

2015/10/05 12:21:01 [info] 1436#684: *1 client
connected to
2015/10/05 12:21:01 [info] 1436#684: *1 proxy connected
2015/10/05 12:21:03 [info] 1436#684: *1 client disconnected, bytes from/to
client:334/192600, bytes from/to upstream:192600/334
>>server1 in upstream aborted after 2 seconds
2015/10/05 12:21:04 [info] 1436#684: *3 client
connected to
2015/10/05 12:21:04 [info] 1436#684: *3 proxy connected
>>server2 (which is the same as server1) connects ok and streams perfect

stream {
  upstream backendst {
# servers are all the same, when using different servers the problem
# when using only one server the logs say the same, abort on first attempt,
after 2 seconds a second attempt works ok

  server {
    listen xxxx;
# extremely tight timeout settings, have tested with 10x these values which
made no difference to the issue
    proxy_connect_timeout 10s; # to proxy backend
    proxy_timeout 10s; # to client
    proxy_next_upstream on;
    proxy_next_upstream_timeout 10;
    proxy_next_upstream_tries 2;
    proxy_pass backendst;

nb. I am aware it says "client disconnected" but this is not the case, wget,
curl, and a dozen other apps all do and log the same thing. Connecting
directly to upstream servers works fine too on the first try (no reconnect).

Posted at Nginx Forum:,262006,262006#msg-262006

More information about the nginx mailing list