Closed jvanalst closed 2 years ago
Turns out I had to modify the provided config.php file manually. I added the following lines to the end of the file:
$CFG->wwwroot = 'https://moodle.mysite.com';
$CFG->reverseproxy = true;
$CFG->sslproxy = 1;
It'd be nice though it there was a MOODLE_DOCKER_PROXY_HOST/_PORT so that the default could sort this stuff automatically instead of having to manually set it and know what I'm doing.
See also: Reverse Proxy Frontend
Thanks, @jvanalst !
Yeah, some specific environments do require some specific configurations. But we cannot create new env variables for every possible Moodle setting, so the approach is to make it to work ok for 95% of people and make specific environments to perform the configuration "manually".
Nice you have "documented" (in this issue), both the problem and the solution so, anybody facing similar problems, will read this and find how to make moodle-docker to work behind proxy.
Ciao :-)
Hi,
Because of our local network security I can't access the container directly, and have to run it through a Proxy for team testing/development (only port 80/443 are available to the world).
I tried running it behind mod_proxy:
The problem is Moodle then tries to redirect to localhost:8100 because of the ProxyPreserveHost setting. If I leave the ProxyPreserveHost off, then Moodle can't link correctly to itself (e.g. it tries to access .css files through localhost:8100 instead of moodle.mysite.com).
I also tried using:
But that just makes Moodle redirect to moodle.mysite.com:8100 instead of localhost:8100.
I found some proxy settings in the Moodle config table, but I'm having trouble finding documentation for them:
Any suggestions?