Skip to content

failing to access s3 static website via cloud front

0

Hello folks, I have hosted my website using S3 bucket & followed below steps in https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started-cloudfront-overview.html Installation seems fine initially , but I have faced few issues later.

  1. While accessing the website from different places i have return Forbidden You don't have permission to access / on this server."" error.
  2. In same time I try to surf the website via cloud front Distribution domain name it was successful. However the certificates seems differ in actual domain name vs distribution domain name

Not able to troubleshoot the issue yet . Appreciate some one guide me

  • can you share your bucket policy and your cloudfront origin configuration pls?

2 Answers
0

Have you added your CNAME to your cloudfront configuration if thats where its failing vs the cloudfront generated name?

EXPERT

answered 2 years ago

  • Seems I have missed the CNAME instead I have A record. May I know what should be in CNAME. this part is not clear on me . " Once your new certificate appears in Pending status, choose the certificate ID, and on the certificate details page, choose Create record in Route 53 to automatically add the CNAME records for your domains, and then choose Create records.

    The Certificate status page should open with a status banner reporting Successfully created DNS records."

    1. do I need recreate the certificate as well? Thank you for your feedback
0

When you receive the "Forbidden" message is it from a CloudFront URL or from a S3 URL? If it is from a S3 URL, make sure that when you configure the CloudFront origin pointing to S3 that you use the regional endpoint name and not the global endpoint name.

If you use the global endpoint name it will eventually work (it may take a few hours) but using the regional endpoint name will work immediately.

EXPERT

answered 2 years ago

  • Forbidden is from my web url . Where it success with Cloudfront URL. I used CF URL access mode not S3 access mode. It's globally end point . I will think of using regional endpoint. Thank you for your feedback

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.