Origin pull on Amazon Cloudfront

Since mid 2010 Amazon Web Services Cloudfront CDN has supported origin pull from non-S3 storage. I’ve been using Cloudfront for some time, but always S3 based objects.

Steps to set up Amazon Cloudfront for origin pull on non-S3 objects:

Create a Cloudfront distribution (I do this via Cloudberry S3 Explorer Pro), setting the location of the non-s3 server ‘mydomain.co.uk’

Create a subdomain: img.mydomain.co.uk

Map the subdomain to the cloudfront ID -(I used my server’s cPanel’s Advanced DNS Zone editor).

img:mydomain.co.uk : qwerty12345.cloudfront.net

er… that’s it :)

Now _any_ image previously served via:

http://mydomain.co.uk/images/myimage.jpg

Can be requested via the Cloudfront edge network using:

http://img.mydomain.co.uk/images/myimage.jpg

For example:

http://allbs.co.uk/images/Red_Fox_400.jpg

is via my web server

and

http://img.allbs.co.uk/images/Red_Fox_400.jpg

is via CDN origin pull.