By using AWS re:Post, you agree to the Terms of Use
/Cloudfront responded AccessDenied or NoSuchKey/

Cloudfront responded AccessDenied or NoSuchKey


For example, 1. Returns AccessDenied error.

But the URL below is done responding successfully. Returns NoSuchKey error.

But the URL below is done responding successfully.

Both are setup correctly. I enbaled S3 hosting for the contents(index.html as the default page is setup). Made the bucket and all the objects under the bucket public access. ACL are both enabled. Cloudfront has default root object.

Please let me know which steps I might have missed. Many thanks.

2 Answers

CloudFront allows you to specify a default root object like index.html, but it only works on the root of the website (such as > It does not work on any subdirectory (such as When you make a request like this, CloudFront makes a GetObject request to S3 for an object that doesn't exist.

You can implement default document functionality for subdirectories via Lambda@Edge. Please refer to this blog post: for details.

answered 2 months ago
  • Thank you for your answer. But it worked in my other distributions. I can access any subfolders by using /anypath/, no need to specify which root object I need to get. So, I think this is not caused by my setting.


Now, I still can't access But the situation changed. It popped up a download dialog with 0 byte. Seems some tech guys are fixing this bug. Still returns NoSuchKey error.

answered 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions