How do I use Amazon CloudFront with AWS Elastic Beanstalk as the origin?

0

I'm trying to set up an Amazon CloudFront distribution with an AWS Elastic Beanstalk URL as the origin. Then, I registered an A record in Amazon Route 53 with its alias pointing to the CloudFront URL (<example>.cloudfront.net). I set up CloudFront to do the HTTP to HTTPS redirection. When I test this configuration, I get redirected to the Elastic Beanstalk URL. The website using the Elastic Beanstalk URL is displayed instead of the website using the Route 53 domain. However, when I set the Route 53 A record alias to point to Elastic Beanstalk, the website is displayed properly using with the name set in the record. What's the best practice to use CloudFront with Elastic Beanstalk?

AWS
전문가
Tedy_T
질문됨 4년 전3146회 조회
1개 답변
0
수락된 답변

Do the following to resolve this issue:

  1. Set up proper SSL certificate for your host.domain. You can do this with AWS Certificate Manager (ACM).
  2. Use the SSL certificate for the CNAME alias in the CloudFront distribution.
  3. Set the origin of the CloudFront distribution to point to the Elastic Beanstalk hostname.
  4. Create a CNAME record in Route 53 with the CloudFront distribution target (not an alias).

Tips:

  1. Be sure that the certificate names and wildcards are accurate.
  2. Test the configuration without CloudFront first to make sure it works as expected.
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠