diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-11-22 19:22:00 +0100 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-11-22 19:22:00 +0100 |
commit | 6cb377470607f6e4e62fb6ca931ab63fb6938390 (patch) | |
tree | a199f86eac10cedcdc3203e0452beb8cc9edb693 /lib | |
parent | c773d071ee947a9065c492a356367ebbd78bc169 (diff) | |
download | nextcloud-server-6cb377470607f6e4e62fb6ca931ab63fb6938390.tar.gz nextcloud-server-6cb377470607f6e4e62fb6ca931ab63fb6938390.zip |
make it possible to manually override the hostname and protocol if the automatic detection from ownCloud fails. This can happen in reverse proxy situations or with loadbalancers setups.
Diffstat (limited to 'lib')
-rwxr-xr-x[-rw-r--r--] | lib/request.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/request.php b/lib/request.php index 287d20d1a5d..c975c84a711 100644..100755 --- a/lib/request.php +++ b/lib/request.php @@ -18,6 +18,9 @@ class OC_Request { if(OC::$CLI) { return 'localhost'; } + if(OC_Config::getValue('overwritehost', '')<>''){ + return OC_Config::getValue('overwritehost'); + } if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { if (strpos($_SERVER['HTTP_X_FORWARDED_HOST'], ",") !== false) { $host = trim(array_pop(explode(",", $_SERVER['HTTP_X_FORWARDED_HOST']))); @@ -40,6 +43,9 @@ class OC_Request { * Returns the server protocol. It respects reverse proxy servers and load balancers */ public static function serverProtocol() { + if(OC_Config::getValue('overwriteprotocol', '')<>''){ + return OC_Config::getValue('overwriteprotocol'); + } if (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { $proto = strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']); }else{ |