this post was submitted on 24 Jun 2023
8 points (90.0% liked)

Selfhosted

40343 readers
665 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 1 year ago
MODERATORS
 

Hi, I was looking at different reverse proxies (Traefik, Caddy, NGINX, Apache (mod_proxy), HAProxy) - I wanted to run two instances of a reverse proxy on different devices for failover. I do not find much about running reverse-proxies in a failover configuration, could someone point me at a resource related to these proxies so I can figure out how to run reverse-proxies in an HA configuration?

Thanks


Edit: The answer seems to be using keepalived, because I will be using this only in my homelab and not exposing it to the internet.

Related links if someone is interested:

top 7 comments
sorted by: hot top controversial new old
[–] pacology 4 points 1 year ago (1 children)

You probably need something like Fabio or Nginx to serve as a load balancer in front of the two instances you want to proxy.

[–] MigratingtoLemmy 2 points 1 year ago (1 children)

Just to be clear, I want an HA setup for my reverse proxies. How will running another reverse-proxy (NGINX) in front of my existing reverse-proxies help me here? This will again become a single point of failure which I'm looking to avoid.

Thanks!

[–] liara 1 points 1 year ago* (last edited 1 year ago) (1 children)

One of the easier options would be something like a DNS-based load balancer with an extremely short TTL (<60 seconds). Cloudflare offers an option that is $5/mo to use.

You would need 2 haproxies to do this.

Otherwise, you're likely looking into something like keepalived with an elastic/additional/failover IP that can swap between instances if a failover situation is detected

edit: something like this would be what I'm talking about for hetzner: https://vitobotta.com/2020/03/20/haproxy-kubernetes-hetzner-cloud/

Essentially you'll need some sort of API access to be able to swap the floating IP between the ha proxy instances on demand if keepalived detects a fault and needs to swap the floater to another machine.

[–] MigratingtoLemmy 2 points 1 year ago

Thank you. Since this will only be for my LAN, I'll start reading up on keepalived. Thanks for mentioning it.

Related links if someone is interested:

Thanks!

[–] [email protected] 3 points 1 year ago (1 children)

Haproxy +keepalived can do it well, but you need a floating ip

[–] MigratingtoLemmy 1 points 1 year ago

Hi, could you explain more about why I'll need a VIP? I don't ever access an IP whilst using the reverse-proxy, what IPs would keepalived need to create a VIP (I can certainly allocate an IP, I just need to know how keepalived will work with it).

Thanks! In theory, this should work with other reverse-proxies like Traefik too, yes? Although I like the look of HAProxy haha

[–] [email protected] 1 points 1 year ago

My current setup is a nginx instance to load balance to 3 nginx proxy manager instances

Can find plenty of guides on how to use a basic nginx config to load balance, and then nginx proxy manager can use a database and shared certificates.