2 個答案
- 最新
- 最多得票
- 最多評論
3
Thanks for the detailed description. You are getting 403 Forbidden
due to the origin request policy AllViewer
being used. In this case, when you access the website via CloudFront URL, the Host
header similar to d12345678.cloudfront.net
will be forwarded to the Lambda which will not be recognized, resulting in 403.
The solution is to create your custom origin request policy and only forward the necessary values (but not the Host
header.)
已回答 2 年前
-2
Please check out this blog if you haven't already - https://aws.amazon.com/blogs/networking-and-content-delivery/using-amazon-cloudfront-with-aws-lambda-as-origin-to-accelerate-your-web-applications/
相關內容
- 已提問 6 個月前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
Thank you, it works so well, for my case, I also need to also forward
origin
anduser-agent
but it is because of my lambda function code.