diff options
author | friendica <info@friendica.com> | 2015-01-05 16:12:55 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-05 16:12:55 -0800 |
commit | 3185bfe3ca131d471b8fcdc0c94abf1a114486c7 (patch) | |
tree | bf625cf4c59bf521e639018399bf1770d116a6a0 /include/plugin.php | |
parent | 3df3ab563004423477640393eb8e50cb3d2fe8d6 (diff) | |
download | volse-hubzilla-3185bfe3ca131d471b8fcdc0c94abf1a114486c7.tar.gz volse-hubzilla-3185bfe3ca131d471b8fcdc0c94abf1a114486c7.tar.bz2 volse-hubzilla-3185bfe3ca131d471b8fcdc0c94abf1a114486c7.zip |
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
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 2 |
1 files changed, 2 insertions, 0 deletions
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'; |