Skip to content

Commit

Permalink
Merge pull request DirectoryLister#136 from pierew/master
Browse files Browse the repository at this point in the history
Adding Support for Servers behind a Reverse Proxy
  • Loading branch information
PHLAK authored Jun 11, 2017
2 parents d341687 + f0e0af5 commit f9c1b95
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion resources/DirectoryLister.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down

0 comments on commit f9c1b95

Please sign in to comment.