Nginx-Upstream-proxy next upstream-惊天大Bug

upstream backend {
server max_fails=0;
server backup;


location / {
proxy_next_upstream error timeout invalid_header http_500 http_502
http_503 http_504;
proxy_pass http://backend;




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


On Thu, May 31, 2012 at 10:55:11AM -0400, youzhengchuan wrote:

proxy_pass http://backend;

As far as I understand, you are hitting another variant of this bug:

It usually manifests itself with “proxy_next_upstream http_404”,
but max_fails=0 does essentially the same. The bug is fixed in

Maxim D.

p.s. This is English mailing list, please don’t write in Chinese
here. Thank you.

Do something like this:

you need to define a resolver:

resolver; # or your dns serevrs

location / {
set $myupstream;
proxy_pass http://$myupstream;

if you need it to use multiple ip addresses.

Accordance with the above configuration, When the domain,” nginx nslookup results is just a one IP
address, this backend upstream can’t be used.

my apology for my bad english.

Posted at Nginx Forum:,227075,227089#msg-227089

thanks Brian

Posted at Nginx Forum:,227075,227139#msg-227139