Retrieving CloudFront-Forwarded-Proto with PHP

折月煮酒 提交于 2021-01-29 07:01:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!