Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
Use https with X-Forwarded-Proto (issue #92)
Browse files Browse the repository at this point in the history
  • Loading branch information
daliborjanak committed Dec 6, 2016
1 parent 2ead30d commit d7a4ad0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tileserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ public static function serve($routes) {
$request_method = strtolower($_SERVER['REQUEST_METHOD']);
$path_info = '/';
global $config;
$config['protocol'] = ( isset($_SERVER["HTTPS"]) or $_SERVER['SERVER_PORT'] == '443') ? "https" : "http";
$config['protocol'] = ((isset($_SERVER['HTTPS']) or $_SERVER['SERVER_PORT'] == '443') or $_SERVER['X-Forwarded-Proto']) == 'https' ? 'https' : 'http';
if (!empty($_SERVER['PATH_INFO'])) {
$path_info = $_SERVER['PATH_INFO'];
} else if (!empty($_SERVER['ORIG_PATH_INFO']) && strpos($_SERVER['ORIG_PATH_INFO'], 'tileserver.php') === false) {
Expand Down

0 comments on commit d7a4ad0

Please sign in to comment.