summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorStefan Herbrechtsmeier <stefan@herbrechtsmeier.net>2012-09-09 12:54:47 +0200
committerherbrechtsmeier <stefan@herbrechtsmeier.net>2013-01-31 18:42:31 +0100
commitab2b79cda682a697baba2128a21d3a9b5e90853c (patch)
treefbaf5a643bbfa2c4236d574ecb41784f5c859d15 /apps/files
parent411e8e5218e0b0d6dc7e993f283b8a457f780af9 (diff)
downloadnextcloud-server-ab2b79cda682a697baba2128a21d3a9b5e90853c.tar.gz
nextcloud-server-ab2b79cda682a697baba2128a21d3a9b5e90853c.zip
add multiple domains reverse proxy support
Add support for a reverse proxy that handles multiple domains via different web roots (http[s]://proxy.tld/domain.tld/owncloud). As the reverse proxy web root is transparent for the web server the REQUEST_URI and SCRIPT_NAME need manual adjustments. This patch replace the direct use of this _SERVER variables with function calls and extend this functions to overwrite the web root. Additionally it adds a Sabre request backend that extends the Sabre_HTTP_Request to use the same functions.
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/appinfo/remote.php2
-rw-r--r--apps/files/index.php2
2 files changed, 3 insertions, 1 deletions
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php
index 6a78a1e0d75..6c92cc80b69 100644
--- a/apps/files/appinfo/remote.php
+++ b/apps/files/appinfo/remote.php
@@ -32,12 +32,14 @@ OC_Util::obEnd();
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
$lockBackend = new OC_Connector_Sabre_Locks();
+$requestBackend = new OC_Connector_Sabre_Request();
// Create ownCloud Dir
$publicDir = new OC_Connector_Sabre_Directory('');
// Fire up server
$server = new Sabre_DAV_Server($publicDir);
+$server->httpRequest = $requestBackend;
$server->setBaseUri($baseuri);
// Load plugins
diff --git a/apps/files/index.php b/apps/files/index.php
index 7e767cc8a4f..104cf1a55d3 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -36,7 +36,7 @@ OCP\App::setActiveNavigationEntry('files_index');
$dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
// Redirect if directory does not exist
if (!\OC\Files\Filesystem::is_dir($dir . '/')) {
- header('Location: ' . $_SERVER['SCRIPT_NAME'] . '');
+ header('Location: ' . OCP\Util::getScriptName() . '');
exit();
}