Problems with IP address in links and resources

Problems with IP address in links and resources

- Aaron Milligan の投稿
返信数: 3

I'm running Moodle on a VM from behind a firewall with a reverse proxy routing the subdomain of my site to the local machine.

On my local network, everything works as it should: moodle.domain.com goes to the moodle site, and all links work. If I load my site from outside of my firewall though, I'm able to get the home page of my moodle site, but all the styles and themes are missing, and when I hover over any link, it's going to http://192.168.10.15/somepage.


Is this something I'm missing in my Moodle setup, or do I not have my reverse proxy set up correctly?

Aaron Milligan への返信

Re: Problems with IP address in links and resources

- Visvanath Ratnaweera の投稿
画像 Particularly helpful Moodlers 画像 Translators
What are $CFG->wwwroot, $CFG->reverseproxy and $CFG->sslproxy in $moodle/config.php?

Is there (or, was there) a computer with the IP address 192.168.10.15 in your LAN?
Visvanath Ratnaweera への返信

Re: Problems with IP address in links and resources

- Aaron Milligan の投稿

I started over with a clean installation yesterday.


$CFG->wwwroot = 'http://moodle.domain.com'

$CFG->reverseproxy didn't exist

$CFG->sslproxy also didn't exist.

I inserted $CFG->reverseproxy = 'true', and now I'm able to access my site from outside of my local network, and from the hostname (http://moodle/), but if I try http://moodle.domain.com from my local network, it says "Reverse proxy enabled, server can not be accessed directly, sorry. Please contact server administrator."

Aaron Milligan への返信

Re: Problems with IP address in links and resources

- Emma Richardson の投稿
画像 Documentation writers 画像 Particularly helpful Moodlers 画像 Plugin developers

It sounds like that maybe you added the domain name and did not update your database.  I am presuming that your website at one time was just accessed through the ip address?

If you added the domain name later, you need to run the replace.php tool found at "yoursite"/admin/tool/replace/index.php