Amazon CloudFront uses an ever-growing network of edge locations to give your users high speed, low latency access to your content, regardless of where they happen to live.
Until now, CloudFront could serve up content from Amazon S3. In content-distribution lingo, S3 was the only supported origin server. You would store your web objects (web pages, style sheets, images, JavaScript, and so forth) in S3, and then create a CloudFront distribution. Here is the basic flow:

Effective today we are opening up CloudFront and giving you the ability to use the origin server of your choice.
You can now create a CloudFront distribution using a custom origin. Each distribution will can point to an S3 or to a custom origin. This could be another storage service, or it could be something more interesting and more dynamic, such as an EC2 instance or even an Elastic Load Balancer:

Putting intelligence (dynamic processing) behind CloudFront gives you the ability to create content on demand without having to worry about storage, caching, or global distribution. You can have content that appears static (based on its URL) but which is actually built on the fly the first time that it is needed.
This can be handy when the content is reusable but somewhat expensive to create and changes infrequently. I believe that map tiles are the classic example. Imagine a system which overlays a base map with one or more custom layers. Generating all possible combinations of tiles would be prohibitively expensive, and also wasteful since most of them would never be seen. Instead, the path component of each tile's URL can include the parameters needed to generate the tile. If the tile is already present in a particular CloudFront edge location then it will be served up directly, otherwise it will be generated, returned to the edge location, and then used to satisfy future requests (time to live and invalidation notwithstanding).
The newest version of the CloudFront Developer Guide contains some guidelines for the use of custom origins. Here are some of the most important ones:
- Respect the HTTP Keep-Alive header to improve performance.
- Ensure that the Date and Last-Modified headers are accurate on the generated content.
- Do not use query string parameters since these are not preserved by CloudFront.
- Use the Cache-Control header to indicate whether responses can be cached.
- CloudFront accepts HTTP 1.1 requests but makes only HTTP 1.0 requests to the origin server.
- Cookies are forwarded only on misses and Set-Cookie headers are removed from cached content.
The following tools, toolkits, and applications already support this new feature:
- CloudBerry Explorer
- Bucket Explorer - Download info, documentation.
- RightScale
- JetS3t
- CloudBuddy
- Boto
- Cyberduck - info.
Like many of the most popular AWS features, we implemented this one because people like you asked for it! If you have additional ideas or suggestions, post them as comments here or in the CloudFront discussion forum. We're all ears!
If you want to help make CloudFront even cooler, check out these jobs:
- Software Development Engineer - Amazon CloudFront
- Senior System Engineer - Amazon CloudFront
- Product Manager - Amazon CloudFront
- Senior Software Development Manager - Amazon CloudFront
-- Jeff;


Great article! Thanks for enabling this feature. Now we can serve map tiles dynamically without need to upload large amount to S3.
We tested it and it works quite well. Here is an article about it: http://www.giscloud.com/blog/serving-map-tiles-in-realtime-from-edge-locations-through-amazon-cloudfront/
Posted by: GIS Cloud | November 09, 2010 at 09:23 AM
Have been waiting for ages for this feature. When will this be available to configure through the CloudFront console?
Posted by: somegeeks | November 23, 2010 at 10:12 AM
Cyberduck for Mac & Windows now has support to configure Amazon CloudFront custom origins. Please refer to http://trac.cyberduck.ch/wiki/help/en/howto/cloudfront#CustomOriginHTTPHTTPSDistributions for more information.
Posted by: dkocher | November 26, 2010 at 06:39 AM
Will you enable dynamic gzip in your roadmap?
thx!
Posted by: Raanan | December 28, 2010 at 09:14 AM
Gzip css and js it's a must!
Posted by: Camden | December 29, 2010 at 11:12 AM
Bucket Explorer is supporting following all type of distributions for
S3 Origin
1. Public , 2. Private , 3. Public Streaming and 4. Private Streaming Distribution
Non S3 Origin (Custom Origin)
Custom Origin Distribution
Available for Windows (32/64bit exe) / Linux / Mac
For More Details : http://www.bucketexplorer.com/documentation/amazon-s3--more-product-manual-detail.html
Posted by: Tej Kiran | January 06, 2011 at 09:09 PM
Ylastic now supports custom origin as well as invalidations - http://blog.ylastic.com/cloudfront-custom-origin-and-invalidations
Posted by: Pchaganti | January 12, 2011 at 08:04 PM
can someone point me to a site or article that teaches how to optimize a cloudfront using a custom origin?
is it easier to use tools like the above mentioned?
Best,
J
Posted by: jccmz | April 10, 2012 at 06:56 AM
Guys,
Any plans for edge side includes? That would be incredible...
Cheers,
Chris
Posted by: Chris Evans | June 14, 2012 at 04:02 AM
Oh, and any plans for rules based on cookies? I.e. if a certain cookie and / or value exists, forward request straight to origin, if not serve from CloudFront?
Posted by: Chris Evans | June 14, 2012 at 04:06 AM