问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/25823151/retrieving-cloudfront-forwarded-proto-with-php