Receive AccessDenied when trying to access a reloa

2020-02-13 05:50发布

问题:

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 or if they try to access a page using the full url (i.e., www.example.com/home), they will receive an AccessDenied page.

回答1:

S3 doesnt understand route open when you reload and open in new tab. You need to tell S3 is for this route used index.html.Whenever new route open its gives 403 [access denied ] error. for this you need to do setting cloufront to set 403 error page redirect to index.html

Go to aws cloud front and open your configuration then go to Error page tab you will see same as above screenshot