I'm having the same problem as cookiemonster. I was able to get Cloudfront working with the asset_sync gem, https://github.com/rumblelabs/asset_sync, but not per Heroku's article, https://devcenter.heroku.com/articles/using-amazon-cloudfront-cdn
I'm trying to switch away from asset_sync because (1) it adds complexity, and (2) Heroku no longer recommends it.
From my response below you can see that Amazon issues a 301 redirect for each call.
Here are some details for the staging server:
My entire site is https
My staging.rb
config.action_controller.asset_host = "https://d2gfgnx4lxlciz.cloudfront.net"
Cloudfront
I used a generic configuration, only changing the origin:
Domain Name: d2gfgnx4lxlciz.cloudfront.net Origin: sohelpfulme-staging.herokuapp.com Delivery Method: Web CNAMEs: none
HTTP Headers
Request URL:https://d2gfgnx4lxlciz.cloudfront.net/assets/jquery-20129d378db54e4ede9edeafab4be2ff.js Request Method:GET Status Code:301 Moved Permanently Request Headersview source Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8,zh-CN;q=0.6,zh-TW;q=0.4 Cache-Control:no-cache Connection:keep-alive Cookie:optimizelyEndUserId=oeu1387769272844r0.715743659529835; optimizelySegments=%7B%7D; optimizelyBuckets=%7B%7D Host:d2gfgnx4lxlciz.cloudfront.net Pragma:no-cache Referer:https://sohelpfulme-staging.herokuapp.com/testuser User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1700.107 Safari/537.36 Response Headersview source Age:32 Connection:keep-alive Content-Type:text/html Date:Mon, 17 Feb 2014 22:43:36 GMT Location:https://sohelpfulme-staging.herokuapp.com/assets/jquery-20129d378db54e4ede9edeafab4be2ff.js Status:301 Moved Permanently Strict-Transport-Security:max-age=31536000 Transfer-Encoding:chunked Via:1.1 16fab6bd7655623b4e7dcaf090973fc8.cloudfront.net (CloudFront) X-Amz-Cf-Id:oiKeV-b3OrhbtkjXrMtyNI9EMvydfdnZ8Drp2fxojNHiveqBNsttJA== X-Cache:Hit from cloudfront X-Rack-Cache:miss