DNS -> Load Balancer (Caddy) -> Web Server (Caddy)

Hi,

I am trying to use Caddy as my load balancer as well as web server. Both on a different server. I am not able to figure it out and will illustrate what I am trying to do with an example below.

  1. DNS: A record set to Load Balancer IP (1.1.1.1)

  2. Load Balancer: Caddy installed with the below caddyfile

mysite..com {
reverse_proxy 2.2.2.2
}
  1. Web Server: IP is 2.2.2.2 and have below caddyfile
mysite..com {
root * /var/www/html
file_server
}

I am not able to get this working. Ignore the double fullstop before the tld. They are just so I can post the config here. Where I am going wrong? Please help. Thanks!

Please fill out the help topic template, as per the forum rules.

This topic was automatically closed after 30 days. New replies are no longer allowed.