Failover / fault-tolerant configurations

Im using nginx as a load balances for 2 backend servers that run a php application. I need session awareness so Ive enabled ip_hash for the
upstream, but in case one node fails, all requests that should go to
that
node get the error_page.

Is there a way to have session awareness without loosing the redundancy
that 2
backend servers provide?

If not - it is planned to be implemented soon (as part of ip_hash or
another
module so that users can have the current functionality as well)? I`m
guessing that many people would be happy to have session awareness that
redirect requests to another node if the node that should handle the
session
dies (this will end the session which is better than seeing the
error_page).

Pavel Georgiev wrote:

Im using nginx as a load balances for 2 backend servers that run a php application. I need session awareness so Ive enabled ip_hash for the
upstream, but in case one node fails, all requests that should go to that
node get the error_page.

Is there a way to have session awareness without loosing the redundancy that 2
backend servers provide?

What I use is session_mysql over a master-master mysql server, this
should allow you to get the session hash between both servers.

same here

just a simple drop-in replacement for php sessions that uses 5
functions. nothing special. could be setup to be master/master or
anything. it’s very simple in php to override normal session
management :wink:

The thing is I run open source software that I don’t want to modify
myself
(postfixadmin, SquirrelMail), so Im looking for a solution at the load-balancer level. I know I can do this with Pound, but I already have nginx running and servering few sites (and Im quite happy with it), so
I
don’t want another load balancer as well.

Can you give some examples of implementing php sessions in mysql, should
I
decide to go that way?