From f0e0af58259aa9046eaa832e8b10cdf1de33e51f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piere=20W=C3=B6hl?= Date: Thu, 3 Nov 2016 18:16:56 +0100 Subject: [PATCH] Adding Support for Servers behind a Reverse Proxy --- resources/DirectoryLister.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/DirectoryLister.php b/resources/DirectoryLister.php index c038008d8..a90450cdd 100644 --- a/resources/DirectoryLister.php +++ b/resources/DirectoryLister.php @@ -798,7 +798,11 @@ protected function _getAppUrl() { } // Get the server hostname - $host = $_SERVER['HTTP_HOST']; + if (isset($_SERVER['HTTP_X_FORWARDED_HOST'])) { + $host = $_SERVER['HTTP_X_FORWARDED_HOST']; + } else { + $host = $_SERVER['HTTP_HOST']; + } // Get the URL path $pathParts = pathinfo($_SERVER['PHP_SELF']);