Created
May 29, 2017 10:25
-
-
Save kazukomurata/9f0de6734fcf892c374fbae0d9b7f663 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @file | |
* AWS configuration file. | |
*/ | |
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { | |
$base_root = 'https'; | |
} | |
// We're behind a proxy that talks to the web server via HTTP. | |
elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO'])) { | |
$base_root = $_SERVER['HTTP_X_FORWARDED_PROTO']; | |
} | |
elseif (isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'])) { | |
$base_root = $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO']; | |
} | |
// There's no HTTPS spoor -- we must be running HTTP. | |
else { | |
$base_root = 'http'; | |
} | |
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO'])) { | |
$http_host = $_SERVER['HTTP_X_FORWARDED_HOST']; | |
} | |
else { | |
$http_host = $_SERVER['HTTP_HOST']; | |
} | |
$base_url = $base_root .= '://' . $http_host; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment