<div class="gmail_quote">On Wed, Feb 1, 2012 at 11:27 AM, Rick Richardson <span dir="ltr"><<a href="mailto:rick.richardson@gmail.com">rick.richardson@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I have a requirement to route dynamically by domain to a set of all<br>
participating peers similar to the Dynamic Request Routing Based on<br>
Redis in Open Resty, the difference is that if one upstream peer is<br>
down, I'd like to fail over to the next one. So Redis would return a<br>
priority-sorted list of upstream peers for any given domain instead of<br>
1.<br>
<br></blockquote><div><br></div></div>Well, just put multiple (redis) servers into every upstream config block, like this:<br><br> upstream A {<br> server <a href="http://foo.com:6379">foo.com:6379</a>;<br> server <a href="http://bar.com:6379">bar.com:6379</a> backup;<br>
}<br><br>Then <a href="http://bar.com:6379">bar.com:6379</a> will be a backup node for <a href="http://foo.com:6379">foo.com:6379</a> when <a href="http://foo.com:6379">foo.com:6379</a> is down.<br><br>Best regards,<br>
-agentzh<br><br>