Problems serving .js and .css assets cloudfront CDN Heroku Rails 4 App -
i trying host assets of rails 4 app on cloudfront cdn. used use asset_sync , s3 wanted switch on cdn.
when go heroku app, see pages bare html. none of js or css being loaded.
these errors getting console:
screenshot of console errors: http://i61.tinypic.com/15rxdsj.jpg
also, not sure if have set origin domain name , origin path correctly on cloudfront origin settings. using heroku app url origin domain name , "/production/assets" origin path.
production.rb file: http://pastebin.com/2dzlpgfe
i have been trying unsuccessfully past week heroku app display css , js. appreciate insight. in advance!
moving cloudfront isn't drastic change seem think if had working s3. after all, cloudfront distributes contents of s3 bucket edge locations. means have let rails know cdn , not s3.
there lot of things going on. have misconfigured cloudfront, should pointing s3 bucket origin. should test setup checking see asset in browser using cloudfront url. main point cloudfront should have no idea rails app.
meanwhile, can still use assetsync push assets s3 "underneath" assets
path. must configure config.action_controller.asset_host
described here.
Comments
Post a Comment