I was installing website in my EC2 and its DNS is ec2-x-x-xx-xxx.ap-southeast-1.compute.amazonaws.com
. When I add that EC2 DNS in Cloudfront Origin Domain, it was not working. Because website could be open when I type http://ec2-x-x-xx-xxx.ap-southeast-1.compute.amazonaws.com in browser. I need to type http://ec2-x-x-xx-xxx.ap-southeast-1.compute.amazonaws.com/uxp/rt/html/login.html?locale=en-us in browser. That's why it can be configured in Cloudfront. That's why please let me know how to configure Cloudfront like that?
Asked
Active
Viewed 41 times
1

PPShein
- 13,309
- 42
- 142
- 227
-
Cloudfront to point EC2 you have to use load balancer. It cannot be directly point to DNS. – Avinash Dalvi Oct 22 '19 at 08:10
-
see this can help https://stackoverflow.com/questions/33137792/cloudfront-and-ec2 – Avinash Dalvi Oct 22 '19 at 08:11
1 Answers
0
Point your CloudFront to an Application Load Balancer, and the Application Load Balancer to your EC2 instance. You can't point a CloudFront distro directly to an EC2 instance.

avocadatoria
- 493
- 3
- 9