]> git.mjollnir.org Git - moodle.git/commitdiff
lib/setuplib MDL-20166 - Don't abort install on nginx webserver
authorpoltawski <poltawski>
Thu, 27 Aug 2009 07:52:11 +0000 (07:52 +0000)
committerpoltawski <poltawski>
Thu, 27 Aug 2009 07:52:11 +0000 (07:52 +0000)
Thanks to Jordan for the patch. Jordan has done testing and found nginx
seems to work and is planning to do more extensive testing to alert us of
other problems along the way.

lib/setuplib.php

index 885bba28a39e13796a71c09274a278c9e43e1861..66f43b08b9fb1b40a5c3d4d3950aa1465a612756 100644 (file)
@@ -493,6 +493,11 @@ function setup_get_remote_url() {
         $rurl['scheme']   = empty($_SERVER['HTTPS']) ? 'http' : 'https';
         $rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
 
+    } else if (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
+        //nginx
+        $rurl['scheme']   = empty($_SERVER['HTTPS']) ? 'http' : 'https';
+        $rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded
+
     } else if (stripos($_SERVER['SERVER_SOFTWARE'], 'iis') !== false) {
         //IIS
         $rurl['scheme']   = ($_SERVER['HTTPS'] == 'off') ? 'http' : 'https';