简体   繁体   中英

Retrieving CloudFront-Forwarded-Proto with PHP

How can I retrieve CloudFront-Forwarded-Proto using PHP? It appears as a header in the AWS documentation: http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#RequestCustomRemovedHeaders

I tried using $_SERVER['CLOUDFRONT_FORWARDED_PROTO'] or $_SERVER['HTTP_CLOUDFRONT_FORWARDED_PROTO'] , among others, but without success.

How can I do it? What am I missing? I can't find any information or examples on this at all.

Have you configured ClouldFront to forward the header? It doesn't forward it by default.

CloudFront-Forwarded-Proto

https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-protocol

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM