Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70017

What is the reason for the reverseproxy block in '/lib/setuplib.php'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Minor Minor
    • None
    • 3.9.2
    • Installation
    • None
    • MOODLE_39_STABLE

      In the file: /lib/setuplib.php, there is a deliberate blocking of using multiple accessible addresses for the same moodle instance, like the comment says these lines block such configuration but only if there's 'reverseproxy' configuration enabled.

      What is the purpose of this block, why couldn't an admin allow access from different addresses?

       

      // hopefully this will stop all those "clever" admins trying to set up moodle
      // with two different addresses in intranet and Internet
      if (!empty($CFG->reverseproxy) && $rurl['host'] === $wwwroot['host'])

      Unknown macro: { print_error('reverseproxyabused', 'error'); }

      I have managed to allow intranet access through one url, and internet access through another, by not even setting 'reverseproxy' and using nginx as internet revproxy to always replace the moodle local address to the internet exposed address by including the local network port as well as usual provided hostname.. (nginx set-header Host hostname:port)

       

      The reason for this is due to my ISP, which for some reason blocks 'loopback' access,
      So if I try to access my external internet IPv4, from within the local network, I get no response,
      but from an external internet network (like mobile 4G LTE, or other ISP), it works just fine,
      leaving me with the only option to expose moodle both locally (direct) and externally (nginx)
      or also modify hosts file on every computer

            Unassigned Unassigned
            asaf400 asaf400
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.