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
EXPERTE
Tedy_T
gefragt vor 4 Jahren3146 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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.
beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen