Search code examples
amazon-web-servicesamazon-cloudfront

Detecting if http or https protocol in CloudFront custom function


Is it possible, with CloudFront function, to detect or to extract from the request object is HTTP or HTTPS protocol?

I'd like to to it without modifying the Cloudfront Behaviour which automatically redirects from HTTP to HTTPS and my doing it manually.


Solution

  • Not sure how I missed this part..but its' in the documentation https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-cloudfront-headers.html#cloudfront-headers-viewer-location