6

This is new to me so please excuse me if I have no idea what I'm talking about (: I'm trying to set up my own CDN with CloudFront and S3 through a subdomain by adding a CNAME to that subdomain to point to the CloudFront.

It seems like I get a 403 when trying to load the file, this is the original s3 link which seems to be working after setting the permission to everyone to open / download. But when trying to use the subdomain to request the file : http://cdn.chaoscod3r.com/libs/polyfills/json3_polyfill.js ; it seems like I get that 403.

Could anyone help me out with this one ?

RtmY
  • 277
  • 2
  • 9
Roland
  • 163
  • 1
  • 1
  • 5

1 Answers1

10

You've to add the CNAME to the CloudFront distribution's settings as well. Simply goto AWS Console > CloudFront > Distribution > Distribution Settings > Alternate Domain Names(CNAMEs) and add the CNAME value cdn.chaoscod3r.com over there.

http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html

vagarwal
  • 845
  • 6
  • 8
  • 8
    what if I have the CNAME added? I'm getting 403 Error: ERROR The request could not be satisfied. Bad request. – Kalvin Klien Jun 04 '15 at 18:22
  • Make sure in your route53 settings, your A / CNAME records are set up with: Alias Target: `dxxxxxxx.cloudfront.net` <-- *with no period at the end!!!!* – Tim Nov 09 '18 at 15:16
  • is following helpful? https://aws.amazon.com/premiumsupport/knowledge-center/resolve-cloudfront-bad-request-error/ – boldnik Mar 05 '19 at 16:14