I want to load balance 3 IPs. I have followed the caddyfiles docs with example but I can get it. They have kinda telling things quite directly. Now the issue is, I dont know what file do I have to edit to make a load balancer.?
Secondly, Do I have to also install caddy on all the 3 Vms in order to make load balance.
I mean I dont basically know what step do I have to follow. Im completely noob. But have used Nginx a lot and also have done reverse proxy and load balancing using Nginx.
Ill highly appreciate if the answer is with steps.
Do you mean do I have to make changes into /etc/caddy/Caddyfile and what other lines do I have to enter despite proxy / web1.local:80 web2.local:90 web3.local:100.
Thank you for your reply, I have done everything and its working perfectly fine… But one of my setting is giving 502 bad gateway when i access via browser. But when I try other 3 ips it works perfect. Why do I experience a 502 bad gateway…
A 502 Bad Gateway from Caddy means that when you tried to connect to localhost:2020, Caddy tried to proxy your request to http://10.0.0.251 (or .252 or .253) but wasn’t able to establish a connection.
You’ll need to troubleshoot why those endpoints aren’t accepting HTTP connections. Start by using curl -i http://10.0.0.251 from your Caddy host, which will give you a good idea of exactly how that backend is (or isn’t?) responding to Caddy.