Question about loadbalancers

So, I have this PVZ webcam that's sometimes on http://192.168.1.123:80/ and sometimes http://12.34.567.89:80/.
Currently, I have separate subdomains for it [like cam1.domain.xyz and cam2.domain.xyz] which is rather unwieldy when my dad keeps asking which one it is :confused:
I would like to have cam.domain.xyz go to the camera no matter which one it is. I tried just adding a server to the load balancer, but that doesn't seem to work and I sometimes get a bad gateway and sometimes a malformed site. keep in mind the camera only exists in one location at a time

TL;DR: How do I make cam.domain.xyz go to this PVZ camera [web interface] no matter which ip its currently on?

Hi @TekExplorer

You'll want to add a healthcheck to your servers section.

1 Like

this is my existing service (that doesnt really work)

  [http.services.PVZ-cam-svc]
    [http.services.PVZ-cam-svc.loadBalancer]
      passHostHeader = true
      [[http.services.PVZ-cam-svc.loadBalancer.servers]]
        url = "http://192.168.1.123:80/"
      [[http.services.PVZ-cam-svc.loadBalancer.servers]]
        url = "http://12.34.56.78:80/" 

I'm not really sure where to put the health check (I would also appreciate a yml version, as I want to get a better idea of how things work)

I just use path: / for services that don't have a healthcheck endpoint. I use yaml. But the TOML below looks straight forward to implement.

This is directly from the documentation example. Update the labels accordingly.

## Dynamic configuration
[http.services]
  [http.services.Service-1]
    [http.services.Service-1.loadBalancer.healthCheck]
      path = "/health"
      interval = "10s"
      timeout = "3s"
1 Like

It seems to work, fingers crossed it also works at the other location. will report back if i have an issue.

(thanks for the assist)
(i even turned it into yml format while i was at it)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.