From 758b6a1e4de2370ad28395562d86aef53e19f2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Jan=C3=A1k?= Date: Tue, 6 Dec 2016 18:10:06 +0100 Subject: [PATCH] Fix of X-Forwarded-Proto server variable (issue #92) --- tileserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tileserver.php b/tileserver.php index 68d27e5..877030a 100644 --- a/tileserver.php +++ b/tileserver.php @@ -1228,7 +1228,7 @@ class Router { $request_method = strtolower($_SERVER['REQUEST_METHOD']); $path_info = '/'; global $config; - $config['protocol'] = ((isset($_SERVER['HTTPS']) or $_SERVER['SERVER_PORT'] == '443') or $_SERVER['X-Forwarded-Proto']) == 'https' ? 'https' : 'http'; + $config['protocol'] = ((isset($_SERVER['HTTPS']) or $_SERVER['SERVER_PORT'] == '443') or $_SERVER['HTTP_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) {