nginx failover without load balancing
What you want is an active+passive setup. Here's an example nginx conf snippet to get you going:
upstream backend {
server 1.2.3.4:80 fail_timeout=5s max_fails=3;
server 4.5.6.7:80 backup;
}
server {
listen 80;
server_name whatevs.com;
location / {
proxy_pass http://backend;
}
}
So, 'normally', all requests will go to host 1.2.3.4. If we get three failures to that box, then 4.5.6.7 will take over.