CloudFront giving access denied to subfolders



I have one CloudFront site that will not display index.html folders off the main site. These are discrete JavaScript map applications and keep all needed resources within their own root folder.

This site points to a S3 bucket with public access and the correct GetObjects policy. The static web site hosting all works fine and all folders and subfolders work without issue or error.

In CloudFront both the cloudfront domain and the cname domain both show the root site without issue. However and subfolder that contains an index.html file will only return the generic access denied xml response. I have tried adding individual origins and behaviors (which I have never had to do for this kind of site) and nothing has worked.

The only way I have these folders working is by adding them to other buckets/sites that are working. All of the bucket settings are identical to those in the non working bucket.

I have tried creating new buckets and cloudfront sites to no avail.

Thanks for any help or suggestions.

asked 3 years ago2065 views
1 Answer

I have figured out my issue. When I created the distribution in CloudFront I must not have had static hosting turned on because the origin to the bucket did not include the s3-website-us-region in the name. I have added the correct origin and issue is solved.

answered 3 years 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