Directive proxy_next_upstream doesn't work?

Maxim Dounin mdounin at mdounin.ru
Thu Dec 29 12:35:51 UTC 2011


Hello!

On Thu, Dec 29, 2011 at 04:07:41AM -0500, defage wrote:

> you mean at that moment all of upstream server has to tried,and it
> reponse 504? but at that moment only one app server's log throw error
> info.
> A part of access_log like:
> 10.001 10.001 /cas/login 10.10.2.100:8080 504
> 10.001 10.001 /cas/login 10.10.2.100:8080 504
> 
> If pass to all servers, the log is like below:?
> 10.001 10.001 /cas/login 10.10.2.100:8080, 10.10.2.101:8080,
> 10.10.2.102:8080, 10.10.2.103:8080 504
> 
> 
> the problem is my app server 's log show ,at that moment only one server
> of upstream have 504 error.

It looks like you are trying to handle timeouts, not 504 returned 
by an upstream server.  You have to specify "timeout" in 
proxy_next_upstream directive, not "http_504".

Or better just remove the proxy_next_upstream directive from your 
config, default value "error timeout" is good enough in most 
cases.

Maxim Dounin



More information about the nginx mailing list