Single Page App + Amazon S3 + Amazon CloudFront + - How To Set Up?

  1. I have single page app built with Backbone.js.
  2. I host app (app consists of static files only) on Amazon S3.
  3. I use CloudFront as a Bucket CDN.
  4. App is accessed by -> ->

How I can use service with this stack? I have to somehow detect that WebSpider/WebRobot is accessing the page and redirect it to



It's hard to use with a static Amazon S3 site.

You could stand up an nginx/apache server in front of s3: -> ->

This solution is less ideal because you lose the closest-location benefit of cloudfront.

This is a good article about a custom solution:

David was able to generate the static HTML and save them in S3, then use CloudFlare to detect _escaped_fragment_ in the URL and redirect it to the static HTML on S3.