Load Balancing Problems

Load Balancing Problems

Charles Swinburne發表於
Number of replies: 3

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

評比平均分數: -
In reply to Charles Swinburne

Re: Load Balancing Problems

Leon Stringer發表於
Core developers的相片 Particularly helpful Moodlers的相片

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.

In reply to Leon Stringer

Re: Load Balancing Problems

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
...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 微笑
In reply to Howard Miller

Re: Load Balancing Problems

Leon Stringer發表於
Core developers的相片 Particularly helpful Moodlers的相片

@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)?