I setting up the cloudfront CDN for rails but its not working.
My site is on ec2.
I do following steps.
- Create Distributions
- Add ec2 URL in the Origin Domain Name
- Submit the distributions and It's display me below (See attachment)
For Ruby on Rails side
-
In production.rb file, I added below line
config.action_controller.asset_host = "CDN-DOMAIN-NAME.cloudfront.net"
-
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