Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS s3 SignatureDoesNotMatch error during get Request through Cloudfront

I have two cloudfront and one s3 bucket and in both cloudfront i have added s3 bucket as a origin. (i am using origin access identity to serve s3 content) I added same behavior in both cloudfront. My problem is I am able to access get s3 using only one cloudfront and its throwing error SignatureDoesNotMatch with other cloudfront. For example: https://cloudront1url/images/a.jpg is working but https://cloudfront2url/images/a.jpg is not working.

Error that i am getting is click here

like image 952
Ankit Avatar asked Dec 20 '19 21:12

Ankit


People also ask

How do I access my S3 bucket from CloudFront?

Open the CloudFront console. Choose Create Distribution. Under Origin, for Origin domain, choose your S3 bucket's REST API endpoint from the dropdown list. Or, enter your S3 bucket's website endpoint.

How do I fix CloudFront error 403?

A custom origin is returning the 403 error A 403 error might be caused by an AWS WAF or custom firewall configuration made at the origin. To troubleshoot, make the request directly to the origin. If you can replicate the error without CloudFront, then the origin is causing the 403 error.

When working with S3 through the API you get an error response as 409 conflict What could be the reason for this?

You are working with the S3 API and receive an error: 409 Conflict. What is a possible cause of this error? You're attempting to delete a bucket without first removing the contents in the bucket. Explanation: A 409 HTTP Status Code can indicate a BucketNotEmpty error code.

Why is CloudFront Access Denied?

If your distribution doesn't have a default root object defined, and a requester doesn't have s3:ListBucket access, then the requester receives an Access Denied error. The requester gets this error instead of a 404 Not Found error when they request the root of your distribution.


1 Answers

I got the issue. in behavior i was using "Cache Based on Selected Request Headers" (whitelist option) for s3 origin. I was white listing "host" header. when i choose option "none" in "Cache Based on Selected Request Headers" issue gets resolved.

like image 118
Ankit Avatar answered Sep 20 '22 14:09

Ankit