lundi 13 février 2017

S3 and Cloudfront throwing error on page reload

Vote count: 0

Somehow when I'm using the website URL (I've setup Amazon ACM as well), it works fine but when I try to refresh the page, it throws an error such as:

enter image description here

I'm using a reactJS SPA website to host the website on Cloudfront through S3. I've made the necessary changes on S3 for the permissions:

Bucket Policy:

{
    "Version": "2012-10-17",
    "Id": "Policy1485855809339",
    "Statement": [
        {
            "Sid": "Stmt1485855807310",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::mydomain.com/*"
        }
    ]
}

I've created two buckets: mydomain.com and www.mydomain.com I've redirected all requests from www.mydomain.com to mydomain.com with the help of S3 redirect.

I've now created a Cloudfront distribution with the help of S3 as the origin and the following configuration:

enter image description here

Please let me know if more information is needed

asked 35 secs ago

Let's block ads! (Why?)



S3 and Cloudfront throwing error on page reload

Aucun commentaire:

Enregistrer un commentaire