I am setting up Amazon CloudFront to distribute the contents of an S3 bucket and it works fine when I use the xxxxxxx.cloudfront.net Amazon gives me.
However, I want to use static.mydomain.com to access my files. I have followed Amazon's instructions and have added a CNAME record from static.mydomain.com to xxxxxx.cloudfront.net and I have also specified that CNAME (static.mydomain.com) in my CloudFront distribution properties.
Still, I can't access my files from static.mydomain.com.
I am with MediaTemple and static.mydomain.com only serves me the default MediaTemple server page. When I request static.mydomain.com/myfile.css it gives me 'Sorry, invalid request'.
Any idea?
In CloudFront, an alternate domain name, also known as a CNAME, lets you use your own domain name (for example, www.example.com) in your files' URLs instead of using the domain name that CloudFront assigns to your distribution.
Replace YourDistributionID with the ID of your distribution. Replace YourCNAME with the conflicting CNAME alias. Note: To verify ownership, you must have read access to YourDistributionID. You must also have an SSL certificate associated with the CloudFront distribution that secures the conflicting CNAME.
you need to add your domain static.mydomain.com into "Alternate Domain Names(CNAMEs)" also make sure your files have read access to anyone, in other words, your files are public.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With