Moodle 3.7 & Apache & reverse proxy results ERR_TOO_MANY_REDIRECTS

Solution 1:

I have no access to web server config so I have to find this workaround. File lib/setuplib.php, line 900 in my case, Moodle comment of this: $CFG->sslproxy specifies if external SSL appliance is used (That is, the Moodle server uses http, with an external box translating everything to https).

Change

  if (empty($CFG->sslproxy))

for

  if (!empty($CFG->sslproxy))

That was all needed to begin installation normally. (after two hours of debugging inserting die()'s everywhere)

Solution 2:

I had the same problem. Do not change anything in setuplib.php. Simply remove the $CFG->reverseproxy = true; in php.config and include the route to your moodle installation as https://.... in the $CFG->wwwroot of config.php.

So, your config.php file would contain:

$CFG->wwwroot = "https://server/dirs";
$CFG->sslproxy = true;