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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南