Merge branch 'w05_MDL-26182_20_nginx' of git://github.com/skodak/moodle
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 31 Jan 2011 11:33:16 +0000 (12:33 +0100)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 31 Jan 2011 11:33:16 +0000 (12:33 +0100)
lib/setuplib.php

index cbf6ffd..46028a7 100644 (file)
@@ -750,6 +750,9 @@ function setup_get_remote_url() {
 
     } else if (stripos($_SERVER['SERVER_SOFTWARE'], 'nginx') !== false) {
         //nginx - not officially supported
+        if (!isset($_SERVER['SCRIPT_NAME'])) {
+            die('Invalid server configuration detected, please try to add "fastcgi_param SCRIPT_NAME $fastcgi_script_name;" to the nginx server configuration.');
+        }
         $rurl['scheme']   = empty($_SERVER['HTTPS']) ? 'http' : 'https';
         $rurl['fullpath'] = $_SERVER['REQUEST_URI']; // TODO: verify this is always properly encoded