1 Answer
- Newest
- Most votes
- Most comments
4
- Make sure the CloudFront distribution is configured to require signed cookies: Go to your CloudFront distribution settings in the AWS Management Console. Under the "Behaviors" tab, make sure the "Restrict Viewer Access (Use Signed URLs or Signed Cookies)" is set to "Yes." Confirm that the "Trusted Key Groups" or "Trusted Signers" are set correctly with the key pair you're using.
- Review the CloudFront behavior settings: Make sure the "Forward Cookies" setting is set to "All" 3.Modify the cookie path and domain: Update the cookie path and domain in the setcookie() function. If your CloudFront distribution is on a subdomain, you should set the cookie path to the root ("/") and the domain to the subdomain (e.g., "cookietest.ourwebsite.com"). 4.Verify that the cookies are being sent with the request: Use browser developer tools to check if the cookies (CloudFront-Key-Pair-Id, CloudFront-Policy, and CloudFront-Signature) are being sent with the request to CloudFront.
- Check the CloudFront access logs: Enable access logging for your CloudFront distribution. Check the logs in the specified S3 bucket for more information about the 403 error. This might give you a better idea of what's causing the issue.
Relevant content
- Accepted Answerasked a year ago
- asked 2 years ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
Thank you for your reply. Yes, the distribution is configured to use signed cookies. The cookies are being sent. I can see them in the Cloudfront standard logs. Do you mean the cache policy shall forward cookies to the origin? I don't think that my origin (an externally hosted icecast server) could handle the Cloudfront cookies. My server logs don't show any login attempts.