Cloudfront and EC2

How to configure Cloudfront before an EC2 instance? I am interested in getting users to get to the Cloudfront URL and not from the EC2 source.

So, instead of hitting ec2-52-64-xxx-xxx.ap-southeast-2.compute.amazonaws.com, users would end up in d111111abcdef8.cloudfront.net.

My intention is to save money on hosting by reducing the traffic load and CPU load on the EC2 instance, giving overseas users faster loading times.

Would I just point my DNS to the Cloudfront URL instead of the EC2 source?

+8
source share
4 answers

Would I just point my DNS to the Cloudfront URL instead of the EC2 source?

To a large extent.

DNS URL-, IP-, CloudFront.

-, ... CloudFront , CloudFront , " ".

ec2-...-compute.amazonaws.com .

10-15 URL-, CloudFront, .

... DNS 53, "A" , "" "", CloudFront, .

DNS 53, CNAME DNS, , CloudFront, . jozxyqkexample.cloudfront.net. , apex/root , CNAME ... www.example.com , example.com , DNS, 53 DNS, CloudFront (, "Alias", , , , CNAME).

CloudFront Host ; , , , HTTP-, , .

, CloudFront EC2 IP ( , , , ).

+20

, ec2-52-64-xxx-xxx.ap-southeast-2.compute.amazonaws.com d111111abcdef8.cloudfront.net.

:

  1. AWS CloudFront.

  2. CloudFront:

  3. " ": ( DNS , , ec2-52-64-xxx-xxx.ap-southeast-2.compute.amazonaws.com).
  4. " ": " ": HTTP HTTPS.
  5. " ": "" ( TTL, TTL TTL)
  6. :
  7. :
  8. : : ( ( )).
  9. (CNAMEs) s: URL ,
  10. SSL: SSL , . ( .)

. SSL- ( us-east-1).

  1. 10 15
+2

IP- : com.amazonaws.services.cloudfront.model.InvalidArgumentException: IP-. (: AmazonCloudFront; : 400; : InvalidArgument;

AWS , IP.

DNS (IPv4) " 504 "
, Origin S3 S3 . EC2 . .

0

In addition to the above, you can tell Namecheap to use your Route53 DNS so you can manage it from there. It will save you a headache! Hope this helps! <3

0
source

Source: https://habr.com/ru/post/1611695/


All Articles