Using iptables
for automatic failover or maintenance pages might seem like a strange choice, but it works!
iptables
has an obscure but useful feature, the socket
filter. From the man page:
socket
This matches if an open socket can be found by doing a socket lookup on the packet.
In other words, we can use this filter to redirect incoming connections to a “failover” server when the main server.
Continue reading Automatic Failover and Maintenance Pages with iptables