mercredi 21 décembre 2016

SETTING UP A CLOUDFRONT CDN FOR RAILS

I setting up the cloudfront CDN for rails but its not working.

My site is on ec2.

I do following steps.

For http://ift.tt/2a9q2eA

  1. Create Distributions
  2. Add ec2 URL in the Origin Domain Name
  3. Submit the distributions and It's display me below (See attachment)

enter image description here

For Ruby on Rails side

  1. In production.rb file, I added below line

    config.action_controller.asset_host = "CDN-DOMAIN-NAME.cloudfront.net"

  2. Restart the application and Testing.

But it's not working. When I open CDN url in another tab then it's redirect to my ec2 URL site. I think that is the problem.

So can any one help me what's the problem and why it's redirect to my ec2 URL site?

Aucun commentaire:

Enregistrer un commentaire