找到了這一篇的教學解決了
就是要把這一行 $CFG->loginhttps=0;
加入 config.php 裡面
https://moodle.org/mod/forum/discuss.php?d=227982