From 3185bfe3ca131d471b8fcdc0c94abf1a114486c7 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 5 Jan 2015 16:12:55 -0800 Subject: detect https coming through reverse proxy or load balancer using x-forwarded-proto instead of (actually in addition to testing) $_SERVER['HTTPS'] and/or $_SERVER['SERVER_PORT'] to indicate ssl is enabled --- include/plugin.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/plugin.php b/include/plugin.php index e500ccc56..08decc8e3 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -472,6 +472,8 @@ function script_path() { $scheme = 'https'; elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443)) $scheme = 'https'; + elseif (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' || !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') + $scheme = 'https'; else $scheme = 'http'; -- cgit v1.2.3