Skip to content
Snippets Groups Projects
Commit 7a4bbe2e authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-419] If proxypass include querystring in rebuilt $_SERVER['REQUEST_URI']

parent e6a7855b
Branches
Tags
No related merge requests found
...@@ -85,13 +85,16 @@ function unl_bootstrap_multisite_without_symlinks() { ...@@ -85,13 +85,16 @@ function unl_bootstrap_multisite_without_symlinks() {
} }
/** /**
* Fix some paths when used through a ProxyPass * Fix some paths when used through a ProxyPass.
*/ */
function unl_bootstrap_proxy_pass_support() { function unl_bootstrap_proxy_pass_support() {
if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && isset($_SERVER['HTTP_X_FORWARDED_PATH'])) { if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && isset($_SERVER['HTTP_X_FORWARDED_PATH'])) {
$GLOBALS['base_url'] = 'http://' . $_SERVER['HTTP_X_FORWARDED_HOST'] . $_SERVER['HTTP_X_FORWARDED_PATH']; $GLOBALS['base_url'] = 'http://' . $_SERVER['HTTP_X_FORWARDED_HOST'] . $_SERVER['HTTP_X_FORWARDED_PATH'];
$GLOBALS['cookie_domain'] = $_SERVER['HTTP_X_FORWARDED_HOST']; $GLOBALS['cookie_domain'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_FORWARDED_PATH'] . '/' . request_path(); $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_FORWARDED_PATH'] . '/' . request_path();
if (isset($_SERVER['REDIRECT_QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['REDIRECT_QUERY_STRING'];
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment