I have three servers, i want to use one for load balancing using HAProxy, and the rest is the client. I have installed the load balancer and the other two servers with moodle 4.1 and it worked perfectly when i access the moodle clients directly from the ip. The problem arises when i try accessing via load balancer. For some reason it shows me an "Too many redirects" error when i pressed "Login" button on the homepage. Is there any workaround for this? I can provide some configuration screenshot if needed. Thanks in advance
You probably need to add $CFG->reverseproxy = true;
to config.php
. Depending on the SSL/TLS endpoint you may also need $CFG->sslproxy = true;
or some combination of these settings.
...or $CFG->wwwroot setting is wrong in your config.php on each front-end.
$CFG->reverseproxy just skips a "sanity check" for the wwwroot setting so (in my limited experience) you're just going to get an error about the setting be wrong if you don't have it and need it.
I hate setting up reverese-proxies and load-balancers. Trying to keep in your head what is going on is near impossible
$CFG->reverseproxy just skips a "sanity check" for the wwwroot setting so (in my limited experience) you're just going to get an error about the setting be wrong if you don't have it and need it.
I hate setting up reverese-proxies and load-balancers. Trying to keep in your head what is going on is near impossible
@Howard: Ah, I didn't read the question properly, you're more likely correct.
@Charles: What's $CFG->wwwroot
set to? The same value on every web server? It must be for Moodle to work properly. And is it a URL with a domain name? Or an IP address (bad idea)?