1

I have a digital ocean server that uses cloudflare for DNS. If for some reason my DO server goes down I want to redirect the traffic to a DO static site app. My first thought is to use a Load balancer. Is this the right idea? I understand that a Load balancer can perform health checks on a server and reroute traffic in between the DNS and your server to other available servers.

The main reason I am posting is that when I look into loadbalancer docs on DO, what I read is that it redirects the next available server for the location. This confuses me a little. What I really want is just a health check for the main server and if it goes down to reroute all traffic to the static DO app site.

  1. Is a load balancer still the correct solution?

  2. Any specific configuration I need to do for the load balancer to get it to work for my situation?

Rohit Gupta
  • 356
  • 2
  • 4
  • 14
  • I don't think a DO load balancer is able to do what you want. If you're willing to stand up your own load balancer, something like haproxy would do what you want (see e.g [this article](https://www.exavault.com/blog/haproxy-load-balancing)). – larsks Feb 02 '23 at 22:04
  • Ok I will look into that. Would this potentially work as well. https://docs.digitalocean.com/products/networking/reserved-ips/quickstart/ From the first description seems promising. – Anders Kitson Feb 02 '23 at 22:58
  • Based on this diagram, could I not have one loadbalancer go to the server and one go to the static site. https://docs.digitalocean.com/screenshots/reserved-ips/ha-diagram-animated.3c24985b42d48e7a307d837a4ac4201e24febf7c8fe386035885b2a096a43712.gif – Anders Kitson Feb 02 '23 at 23:00
  • Oh, maybe! I didn't thoroughly read the DO docs, so if you've found something it's certainly worth trying it out. – larsks Feb 02 '23 at 23:09
  • Yeah I found a way to solve my problem without automating it with healthchecks, but I think i could, it was looking a little expensive to implement two load balancers, so I am just going to have a manual reserved IP switch if something goes wrong. Its not a huge issue if it goes down temporarily. I'll post an answer if I find a way to automate easily and cheaper. – Anders Kitson Feb 02 '23 at 23:18

0 Answers0