Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How do I setup Nginx on two machines so that if the primary machine crashes there is automatic failover to the 2nd machine? And what are the best practices here?

There seems to already be a lot written about how to do failover for backend servers that nginx routes to. This is not what I am asking about.

share|improve this question

1 Answer 1

For simple failure, using the Heartbeat daemon to transfer the IP address to the backup machine is an excellent solution. See Cameron Miller's HOWTO for this. Many other guides are available using the Google search for "heartbeat nginx".

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.