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
EXPERTO
Tedy_T
preguntada hace 4 años3146 visualizaciones
1 Respuesta
0
Respuesta aceptada

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.
respondido hace 4 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas