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年前3147ビュー
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年前

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ