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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 3.9.2
    • Fix Version/s: None
    • Component/s: Installation
    • Labels:
      None
    • Affected Branches:
      MOODLE_39_STABLE

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              asaf400 asaf400
              Participants:
              Component watchers:
              Matteo Scaramuccia, Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: