How to Set Up Moodle to Work from a Subdirectory Using nginx-proxy #2532
Unanswered
raphaeldallorto
asked this question in
Q&A
Replies: 1 comment
-
Have you tried setting |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone,
I’m trying to configure Moodle (v4.5) to run from a subdirectory (/ead) using nginx-proxy in a Docker setup, and I’m running into issues.
Here is my docker-compose.yml file that works without the subdirectory:
To make Moodle accessible at http://moodle.example.com/ead, I tried adding VIRTUAL_PATH=/ead in the Moodle container’s environment, but this results in a "Not Found" error.
I also tried updating the config.php file, located at moodle/moodle_data/config.php according to the docker-compose.yml setup, by appending /ead to $CFG->wwwroot as follows:
$CFG->wwwroot = 'http://' . $_SERVER['HTTP_HOST'] . '/ead';
However, that didn’t work either.
One additional note: For the database to function correctly with this setup, I needed to run the following command to adjust permissions:
sudo chown -R 1001:1001 moodle/mariadb_data/
Does anyone know the correct way to configure Moodle with nginx-proxy to serve from a subdirectory? Any guidance would be greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions