Lua/Redis Routing with Failover

agentzh agentzh at
Wed Feb 1 04:25:06 UTC 2012

On Wed, Feb 1, 2012 at 11:27 AM, Rick Richardson
<rick.richardson at>wrote:

> I have a requirement to route dynamically by domain to a set of all
> participating peers similar to the Dynamic Request Routing Based on
> Redis in Open Resty, the difference is that if one upstream peer is
> down, I'd like to fail over to the next one.  So Redis would return a
> priority-sorted list of upstream peers for any given domain instead of
> 1.
Well, just put multiple (redis) servers into every upstream config block,
like this:

    upstream A {
        server backup;

Then will be a backup node for when down.

Best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx-devel mailing list