max_fails=0 for server directive

Valentin V. Bartenev vbart at nginx.com
Mon Oct 16 15:50:29 UTC 2017


On Sunday 15 October 2017 09:51:27 Ruben wrote:
> When setting max_fails=0 for all server directives used in upstream module.
> So for example:
> 
> upstream chat-servers {
>   hash $arg_chatName;
>   server chat-1 max_fails=0;
>   server chat-2 max_fails=0;
>   server chat-3 max_fails=0;
> }
> 
> Assume a certain ?chatName=xxx is directed to chat-2 server, and this
> server fails. Do I get an error for that connection or does it try chat-3
> server?
> 
> I want it not to go to the next sever but to just fail. Is this the correct
> config?

No.

http://nginx.org/en/docs/http/ngx_http_upstream_module.html#server

 | The zero value disables the accounting of attempts.

 | What is considered an unsuccessful attempt is defined by the
 | proxy_next_upstream, fastcgi_next_upstream, uwsgi_next_upstream,
 | scgi_next_upstream, and memcached_next_upstream directives.

http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_next_upstream

 | off
 |   disables passing a request to the next server.


 wbr, Valentin V. Bartenev



More information about the nginx mailing list