Static Site Deployment in AWS S3 with CloudFront

Ryan Fisch

I am trying to set up a static website that has been configured to use index.html default documents. I have the following bucket policy set up in S3:

{
  "Version": "2008-10-17",
  "Statement": [
    {
      "Sid": "Allow Public Access to All Objects",
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::www.risendeadmc.com/*",
      "Condition": {}
    }
  ]
}

The 2nd step is I created a CloundFront distribution to distribute this S3 content.

Issue 1: Sub folders are still accessible by CDN domain name but index.html no longer load as default for document and hitting folder causing a content download.

I then set up a A record Alias to the CDN distribution in Route53 and now nothing resolves with a 403 Forbidden error no matter what I use.

Any configuration advise to resolve would be greatly appreciated.

What I am looking for is the ability to use my domain set up in Route53 to point to the CloudFront Distribution to provide access (with index.html default) content access.

I would like to keep root and sub folder default access points to non file suffixed endpoint reference:

http://mydomain.com/root

or

http://mydomain.com/root/sub/subroot

rather than address index.html

imperalix

You will want to make sure that you are setting your default root object in Amazon S3 and that your origin is the S3 Website endpoint.

Example origin: www.example.com.s3-website-us-east-1.amazonaws.com

http://docs.aws.amazon.com/AmazonS3/latest/dev/website-hosting-custom-domain-walkthrough.html

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Configuring environment variables for static web site on AWS S3

From Dev

Deploying static site with s3 and cloudfront using python boto3

From Dev

How do you invalidate cache of index.html for a static site hosted on S3 with cloudfront?

From Dev

Have static site on Amazon S3 and Cloudfront, how to add sub-domain hosted elsewhere?

From Java

HTTPS, AWS ELB, CloudFront & S3

From Dev

Use AWS S3 vs Cloudfront

From Dev

AWS CloudFront redirecting to S3 bucket

From Dev

Angular on AWS (Cloudfront/S3) for Safari

From Dev

Rails AWS assets on Cloudfront & s3

From Dev

AWS S3, CloudFront and SSL

From Dev

CORS AWS S3 and cloudfront

From Dev

AWS API Gateway endpoint gives CORS error when POST from static site on S3

From Dev

Use AWS CloudFront for PHP site

From Dev

How do you create an AWS Cloudfront Distribution that points to an S3 (static hosted) Website Endpoint using the SDK?

From Dev

Shell Script for Deployment in AWS s3

From Dev

Cloudfront URL vs S3 URL on AWS

From Dev

Creating signed S3 and Cloudfront URLs via the AWS SDK

From Dev

Issue with gzipping, sync of AWS S3, cloudfront and my server

From Dev

Using AWS S3 alone or S3 & Cloudfront for video download

From Dev

Using AWS S3 alone or S3 & Cloudfront for video download

From Dev

Amazon S3 static site serves old contents

From Dev

Best strategy to deploy static site to s3 on github push?

From Dev

Continuous deployment for website into AWS S3 using Bitbucket pipelines

From Dev

Grunt module(s) to upload all static assets to S3 / CloudFront, replace paths, and invalidate old assets

From Dev

Using custom fonts hosted on AWS S3 in a Wordpress site

From Dev

How to speed up my wordpress site(EC2, CloudFront, S3)?

From Dev

How to speed up my wordpress site(EC2, CloudFront, S3)?

From Dev

Subfolder redirect issue with static website hosting using S3, CloudFront and Origin Path

From Dev

Cannot fetch static files from S3 via CloudFront CDN

Related Related

  1. 1

    Configuring environment variables for static web site on AWS S3

  2. 2

    Deploying static site with s3 and cloudfront using python boto3

  3. 3

    How do you invalidate cache of index.html for a static site hosted on S3 with cloudfront?

  4. 4

    Have static site on Amazon S3 and Cloudfront, how to add sub-domain hosted elsewhere?

  5. 5

    HTTPS, AWS ELB, CloudFront & S3

  6. 6

    Use AWS S3 vs Cloudfront

  7. 7

    AWS CloudFront redirecting to S3 bucket

  8. 8

    Angular on AWS (Cloudfront/S3) for Safari

  9. 9

    Rails AWS assets on Cloudfront & s3

  10. 10

    AWS S3, CloudFront and SSL

  11. 11

    CORS AWS S3 and cloudfront

  12. 12

    AWS API Gateway endpoint gives CORS error when POST from static site on S3

  13. 13

    Use AWS CloudFront for PHP site

  14. 14

    How do you create an AWS Cloudfront Distribution that points to an S3 (static hosted) Website Endpoint using the SDK?

  15. 15

    Shell Script for Deployment in AWS s3

  16. 16

    Cloudfront URL vs S3 URL on AWS

  17. 17

    Creating signed S3 and Cloudfront URLs via the AWS SDK

  18. 18

    Issue with gzipping, sync of AWS S3, cloudfront and my server

  19. 19

    Using AWS S3 alone or S3 & Cloudfront for video download

  20. 20

    Using AWS S3 alone or S3 & Cloudfront for video download

  21. 21

    Amazon S3 static site serves old contents

  22. 22

    Best strategy to deploy static site to s3 on github push?

  23. 23

    Continuous deployment for website into AWS S3 using Bitbucket pipelines

  24. 24

    Grunt module(s) to upload all static assets to S3 / CloudFront, replace paths, and invalidate old assets

  25. 25

    Using custom fonts hosted on AWS S3 in a Wordpress site

  26. 26

    How to speed up my wordpress site(EC2, CloudFront, S3)?

  27. 27

    How to speed up my wordpress site(EC2, CloudFront, S3)?

  28. 28

    Subfolder redirect issue with static website hosting using S3, CloudFront and Origin Path

  29. 29

    Cannot fetch static files from S3 via CloudFront CDN

HotTag

Archive