Created
June 18, 2015 15:24
-
-
Save gansbrest/586265cdefac9e9674e7 to your computer and use it in GitHub Desktop.
scrip_name_proxy.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc | |
index 5b28e98..a9b3410 100644 | |
--- a/includes/bootstrap.inc | |
+++ b/includes/bootstrap.inc | |
@@ -438,7 +438,14 @@ function conf_init() { | |
// $_SERVER['SCRIPT_NAME'] can, in contrast to $_SERVER['PHP_SELF'], not | |
// be modified by a visitor. | |
- if ($dir = trim(dirname($_SERVER['SCRIPT_NAME']), '\,/')) { | |
+ | |
+ // Allow serving through proxy | |
+ $scriptName = $_SERVER['SCRIPT_NAME']; | |
+ if (isset($_SERVER['HTTP_X_SCRIPT_NAME'])) { | |
+ $scriptName = $_SERVER['HTTP_X_SCRIPT_NAME']; | |
+ } | |
+ | |
+ if ($dir = trim(dirname($scriptName), '\,/')) { | |
$base_path = "/$dir"; | |
$base_url .= $base_path; | |
$base_path .= '/'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment