- Newest
- Most votes
- Most comments
The headers you need are described here in the User-Agent headers section: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/RequestAndResponseBehaviorCustomOrigin.html#request-custom-headers-behavior
The recommendation is to configure CloudFront to forward these headers to your custom origin. This CloudFront doc lists the options, you may want to try the "All" setting first and then create a Whitelist for the specific headers you need: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValuesForwardHeaders
Update: Another approach, which is likely better suited to your use case, would be to use the AWS CloudFront console and create a cache policy and an origin request policy: https://repost.aws/knowledge-center/configure-cloudfront-to-forward-headers
If this answer addresses your issue, please upvote and accept the answer. Thank you.
That is a plan B. To have CloudFront deal with one of the request using custom behaviors. Yet it would look really bad to have all request going to api.mydomain.com and just one of them through mydomain.com Once again. The CloudFront distribution in this case is managed by AWS. We do not have it under CloudFront distributions list.
Assuming the CloudFront distro was created in API Gateway when setting up custom domain name for the API. Have you tried enabling the Caching check boxes (in your screen cap above)?
Response will contain uniq token for IVS stream, so it's not supposed to be using caching at all. And once again everything works fine as long as request goes to the same api with such url https://XXXXXXXXXX.execute-api.eu-west-1.amazonaws.com/production. Only Custom Domain Name alias causes issues for some reason.
Relevant content
- asked a day ago
- Accepted Answerasked 6 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
What type of API Gateway Protocol and Endpoint Type are you using? You can find this on the APIs tab of the API Gateway console.
The protocol is REST Endpoint type is Edge