Hi Leon!
Thanks so much for the help! I went ahead and double-checked all of my settings. I am not currently using TLS on either the reverse proxy nor the Moodle instance as it is running on my laptop.
I went ahead and tried
git commit
80f0b1516508bed028eaa6c747c0b8b58eaa87f8. This does not seem to fix the problem.
--------------------------------------------------------------------
My Reverse Proxy's config is as follows:
--------------------------------------------------------------------
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
keepalive_timeout 200;
#include /etc/nginx/conf.d/*.conf;
server {
server_name mysite.com;
# Main Moodle Instance
location /learn {
proxy_pass http://moodle/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $
host:$server_port;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 1000s;
proxy_redirect default;
}
}
}
--------------------------------------------------------------------
Moodle runs in a separate Nginx container. Here is its nginx.conf
--------------------------------------------------------------------
daemon off;
error_log /dev/stdout info;
events {
worker_connections 1000;
}
http {
access_log /dev/stdout;
error_log /dev/stdout;
server {
listen 80;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/index.php;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_read_timeout 1000;
}
}
}
--------------------------------------------------------------------
My Moodle config.php is stock except for the following changes:
--------------------------------------------------------------------
$CFG->reverseproxy = true;