Receive AccessDenied when trying to refresh a page on my website - S3 and CloudFront

0

Hello,

For a while, I was simply storing the contents of my website in a s3 bucket and could access all pages via the full url just fine. I wanted to make my website more secure by adding an SSL so I created a CloudFront Distribution to point to my s3 bucket.

The site will load just fine, but if the user tries to refresh the page, they will receive an AccessDenied page.

I have a policy on my s3 bucket that restricts access to only the Origin Access Identity and index.html is set as my domain root object.

I am not understanding what I am missing.

Any help is much appreciated.

1개 답변
0

Try these steps to fix the issue:

  1. Ensure CloudFront's Origin Access Identity can access all files in your S3 bucket.
  2. Check all objects in S3 have the required permissions for CloudFront access.
  3. Redirect 404: Not Found errors to /index.html with a 200: OK response.
  4. Check CloudFront Origin Settings: Match the "Origin Protocol Policy" with your S3 setup.
  5. Check Viewer Protocol Policy: Set to "Redirect HTTP to HTTPS".
  6. Clear CloudFront cache after changes. https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html
AWS
Rumaisa
답변함 8달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠