From d7a4ad03c1a36a41e2347a0af86e7f0ff147d99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dalibor=20Jan=C3=A1k?= Date: Tue, 6 Dec 2016 17:58:22 +0100 Subject: [PATCH] Use https with X-Forwarded-Proto (issue #92) --- tileserver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tileserver.php b/tileserver.php index 8c57f41..68d27e5 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') ? "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) {