Search code examples
htmlfacebookiframeamazon-cloudfront

Hosting Facebook iframes on pages on Cloudfront


I've switched my Facebook page to pull an iframe as a result of Facebook's recent announcement that they were supporting iframes in pages. Since you need to host the iframe page outside of Facebook, I figured it would be nice to do using Cloudfront to host the files (an HTML page, a CSS stylesheet and a jpg image). Unfortunately, despite setting the permissions on the Cloudfront files to 744, the iframe page loads correctly in a browser, but when called from Facebook, I get this error message.

When I host the same files on my Media Temple server, the iframe on the actual Facebook page also loads correctly.

Is there a reason why Facebook and Cloudfront don't play together? I haven't been able to find one so far.


Solution

  • OK, it can be done: but you need to host the images on Cloudfront and the rest of the content on S3. Amazon provides a set of clear instructions on how to this. Issue solved.