//SSL
if (
isset($_SERVER['HTTPS'] ) ||
isset($_SERVER['REDIRECT_HTTPS']) ||
( isset($_SERVER['HTTP_X_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_X_FORWARDED_PROTO'] ) || //AWS
( isset($_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] ) && 'https' === $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO']) //AWS(CloudFront)
) {
return true;
//非SSL
} else {
return false;
}
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
11