Skip to content

Commit aecd4bf

Browse files
committed
Merge pull request facebookarchive#50 from evanadelman/master
SSL detection breaks in NGINX
2 parents 1899bf9 + 2041c94 commit aecd4bf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/base_facebook.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,10 +1148,16 @@ protected function getHttpProtocol() {
11481148
}
11491149
return 'http';
11501150
}
1151+
/*apache + variants specific way of checking for https*/
11511152
if (isset($_SERVER['HTTPS']) &&
11521153
($_SERVER['HTTPS'] === 'on' || $_SERVER['HTTPS'] == 1)) {
11531154
return 'https';
11541155
}
1156+
/*nginx way of checking for https*/
1157+
if (isset($_SERVER['SERVER_PORT']) &&
1158+
($_SERVER['SERVER_PORT'] === '443')) {
1159+
return 'https';
1160+
}
11551161
return 'http';
11561162
}
11571163

0 commit comments

Comments
 (0)