Reputation: 2346
I'm trying to set up cloudfront to serve my S3 images. I have one origin working to serve my javascript, css and fonts (coming from heroku).
I created a new origin for my images:
Origin Domain Name: MYBUCKET.s3.amazonaws.com
This was auto-populated by cloudfront. I left origin path blank. Restrict Bucket Access is set to 'No'
The URL from s3 works fine: http://MYBUCKET.s3.amazonaws.com/people/pics/000/000/674/medium/open-uri20150807-28718-re2542?1439005733
Replacing the URL with cloudfront does not: http://CLOUDFRONTURL.cloudfront.net/people/pics/000/000/674/medium/open-uri20150807-28718-re2542?1439005733
I invalidated the cache but no luck. What am I doing wrong?
Upvotes: 0
Views: 161
Reputation: 2346
As Michael commented:
If you have multiple origins, you have to log in to cloudfront, click 'Behaviors' and create a behavior with a new 'path pattern'.
In my case assets
has my Heroku deploy as the origin. Images for my models come from the s3
bucket.
Precedence | Path Pattern | Origin
0 | assets/bootstrap | my-heroku-assets
1 | people/* | my-aws-bucket
Upvotes: 1