Here’s the situation: I’m attempting to move all my rails sites from a VPS to Heroku.
My first site is going quite well.
Yea there’s been some growing pains to deal with but I’m learning.
I’m hung up on one thing.
This:
“bad URI or cross-site access not allowed source”
My Font Awesome and I think some Twitter Bootstrap assets are not being found or something about CORS (Cross Origin Resource Sharing) is holding me up.
I’ve encountered a similar problem trying to serve fonts in the Rails asset pipeline via CloudFront (which I think you’re doing, based on the linked article).
IIRC, Rails does not set CORS headers for font files, so fonts served from a CDN are not correctly loaded by some browsers because the requesting host (your domain) is different from the asset host (the CDN).
I resolved this by using the font_assets gem to set the correct Access-Control-Allow-Origin header for font files served from a CDN.
The gem’s README is pretty thorough, but you’ll likely need to configure (in config/environments/production.rb):
After weighing the cost of my VPS vs. Heroku, I decided to revert back to my VPS.
Seeing that Heroku has changed the free dyno package so that they sleep for 6 hours, I really thought hard about it and couldn’t accept not reaching users for 6 hours out of the day when with my VPS, it’s always online.
And $7 per site is just too much when I can serve as many sites as I want for $20 per month.
It was a fun 4 day adventure, changing code and learning more about how to get Heroku to work with AWS (CloudFront and S3)
All in all it was a great learning experience.