<div dir="ltr"><div>Приветствую,<br><br></div>http {<br>    log_format lb '$remote_addr\t[$time_local]\t$http_x_warehouse_code\t$upstream_addr';<br><div><br>    upstream groups {<br>        hash $http_x_warehouse_code consistent;<br>        server <a href="http://127.0.0.1:8001">127.0.0.1:8001</a> max_fails=0;<br>        server <a href="http://127.0.0.2:8002">127.0.0.2:8002</a> max_fails=0;<br>        keepalive 1000;<br>    }<br><br>    server {<br>        listen            80;<br>        access_log  /var/log/nginx/lb_groups.log  lb;<br>        access_log  /var/log/nginx/access.log  main;<br><br>        location / {<br>            proxy_pass  <a href="http://groups">http://groups</a>;<br>            proxy_http_version 1.1;<br>            #proxy_next_upstream error timeout http_502;<br>            proxy_next_upstream off;<br>        }<br>    }<br>}<br><br></div><div>При этом<br><br># grep , lb_groups.log <br>10.98.26.35    [25/Dec/2015:17:40:01 +0300]    552277    <a href="http://127.0.0.2:8002">127.0.0.2:8002</a>, <a href="http://127.0.0.1:8001">127.0.0.1:8001</a>, <a href="http://127.0.0.1:8001">127.0.0.1:8001</a><br>10.98.21.188    [25/Dec/2015:17:41:28 +0300]    543382    <a href="http://127.0.0.1:8001">127.0.0.1:8001</a>, <a href="http://127.0.0.2:8002">127.0.0.2:8002</a><br>10.98.65.252    [25/Dec/2015:17:47:06 +0300]    210024    <a href="http://127.0.0.2:8002">127.0.0.2:8002</a>, <a href="http://127.0.0.1:8001">127.0.0.1:8001</a><br>10.98.10.65    [25/Dec/2015:17:47:06 +0300]    703024    <a href="http://127.0.0.2:8002">127.0.0.2:8002</a>, <a href="http://127.0.0.1:8001">127.0.0.1:8001</a><br>10.98.45.143    [25/Dec/2015:17:47:25 +0300]    020122    <a href="http://127.0.0.1:8001">127.0.0.1:8001</a>, <a href="http://127.0.0.2:8002">127.0.0.2:8002</a><br><br></div><div>Вопросы:<br></div><div>1. Почему переключение на следующий апстрим происходит, т.е. почему nginx игнорирует proxy_next_upstream и max_fails=0?<br></div><div>2. Как объяснить nginx'у, что так делать не следует?<br clear="all"></div><div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div>Kind regards,<br>Vladimir.</div></div></div>
</div></div></div>