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.

Maan
feita há um ano738 visualizações
1 Resposta
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
respondido há 9 meses

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas