thank you very much.<div>with <strong style="font-family:monospace;font-size:medium;background-color:rgb(238,238,238)">recursive_error_pages</strong><span style="font-family:monospace;font-size:medium;background-color:rgb(238,238,238)"> </span><code style="font-size:medium;background-color:rgb(238,238,238)">on</code><span style="font-family:monospace;font-size:medium;background-color:rgb(238,238,238)"> </span></div>
<div><font face="monospace" size="3">it works.<br></font><br><div class="gmail_quote">2013/2/6 Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<div><div class="h5"><br>
On Wed, Feb 06, 2013 at 11:23:24AM +0800, 李文伟 wrote:<br>
<br>
> hi:<br>
> now i am looking for a 50x retry method, config like this:<br>
><br>
><br>
><br>
>    upstream jboss8080 {<br>
>     server                        <a href="http://10.1.2.164:8080" target="_blank">10.1.2.164:8080</a> weight=1 max_fails=1<br>
> fail_timeout=2s;<br>
>     server                        <a href="http://10.1.2.174:8080" target="_blank">10.1.2.174:8080</a> weight=1 max_fails=1<br>
> fail_timeout=2s;<br>
>     server                        <a href="http://10.1.2.209:8080" target="_blank">10.1.2.209:8080</a> weight=1 max_fails=1<br>
> fail_timeout=2s;<br>
>     server                        <a href="http://10.1.7.136:8080" target="_blank">10.1.7.136:8080</a> weight=1 max_fails=1<br>
> fail_timeout=2s;<br>
>     server                        <a href="http://10.1.7.137:8080" target="_blank">10.1.7.137:8080</a> weight=1 max_fails=1<br>
> fail_timeout=2s;<br>
>     server                        <a href="http://10.1.7.138:8080" target="_blank">10.1.7.138:8080</a> weight=1 max_fails=1<br>
> fail_timeout=2s;<br>
>   }<br>
><br>
>   server {<br>
> ........<br>
>     location / {<br>
> proxy_next_upstream http_500 http_502 http_503 http_504 timeout error<br>
> invalid_header;<br>
> .......<br>
>       if ( !-f $request_filename ) {<br>
> proxy_pass                <a href="http://jboss8080" target="_blank">http://jboss8080</a>;<br>
> break;<br>
>       }<br>
>     }<br>
><br>
>     error_page                    500 502 503 504  /50x.html;<br>
>       location = /50x.html {<br>
>       root                        html;<br>
>     }<br>
>   }<br>
><br>
><br>
> then how proxy_next_upstream control retry times.<br>
<br>
</div></div>Quote from <a href="http://nginx.org/r/upstream" target="_blank">http://nginx.org/r/upstream</a>:<br>
<br>
: If an error occurs when communicating with the server, a request<br>
: will be passed to the next server, and so on until all of the<br>
: functioning servers will be tried. If a successful response could<br>
: not be obtained from any of the servers, the client will be<br>
: returned the result of contacting the last server.<br>
<br>
That is, errors are handled as they appear, and there is no<br>
retry-specific controls except proxy_next_upstream itself.  In a<br>
worst case all servers will be tried.<br>
<div class="im"><br>
> by the way, i used error_page, config like this:<br>
><br>
><br>
> upstream backend  {<br>
>   server localhost:8080 weight=5;<br>
> }<br>
><br>
> upstream backup1  {<br>
>   server localhost:8081 weight=5;<br>
> }<br>
><br>
> upstream backup2  {<br>
>   server localhost:8082 weight=5;<br>
> }<br>
><br>
>     server {<br>
> listen       80;<br>
> server_name  localhost;<br>
> proxy_intercept_errors on;<br>
><br>
> location / {<br>
>     error_page  502 @backup1;<br>
>     proxy_pass  <a href="http://backend" target="_blank">http://backend</a>;<br>
> }<br>
><br>
> location @backup1 {<br>
>     error_page  502 @backup2;<br>
>     proxy_pass <a href="http://backup1" target="_blank">http://backup1</a>;<br>
> }<br>
><br>
> location @backup2 {<br>
>     proxy_pass <a href="http://backup2" target="_blank">http://backup2</a>;<br>
> }<br>
>      }<br>
><br>
> @backup1works, but @backup2 doesn't.<br>
> how can i let backup2 works.<br>
<br>
</div><a href="http://nginx.org/r/recursive_error_pages" target="_blank">http://nginx.org/r/recursive_error_pages</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.com/support.html" target="_blank">http://nginx.com/support.html</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a></font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>————</div>
<div>Regards,</div>
<div>李文伟</div>
<div>software engineer</div>
<div>大众点评网-技术部-团购开发组</div>
<div>Tel:(021)53559777-1700</div>
<div>Mobile:15921585268</div>
<div>QQ:363603327</div>
<div><a href="mailto:MSN%3Amuzi666boy@hotmail.com" target="_blank">MSN:muzi666boy@hotmail.com</a></div>
</div>