Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable HTTPS for Elastic Beanstalk url

I have enabled HTTPS for my custom domain name (haydenclay.page), but I also need the Beanstalk url (app-name.elasticbeanstalk.com) to run through HTTPS as well.

HTTPS does not work currently, because the cert name matches my custom domain name, yielding: ERR_CERT_COMMON_NAME_INVALID

I need HTTPS because I make API requests, and going from HTTPS to HTTP throws a mixed content error. How can I enabled HTTPS on the beanstalk url?

I have already tried making an alias in the console like so

like image 885
Hayden Williams Avatar asked Sep 10 '20 21:09

Hayden Williams


People also ask

How do I change my AWS Elastic Beanstalk URL?

Choose the URL on the overview page, or choose Go to environment on the navigation pane, to navigate to your application's web page. You can change the CNAME on your environment by swapping it with the CNAME of another environment. For instructions, see Blue/Green deployments with Elastic Beanstalk.


1 Answers

Sadly you can't enable https directly for app-name.elasticbeanstalk.com domain. This is because this domain is controlled by AWS. You can only register SSL certificates for domains that you control.

If you want to server your content from EB over ssl, you have generally three options.

  1. Front your instance with load balancer. This is the easiest* way as you can associated ACM SSL certificate with the balancer for your domain.

  2. Front your EB instance with CloudFront (CF). You can setup alternative name for your cloudfront domain with your CF distro and your SSL cert. You can also use ACM for that. Also easy setup, but it should be noted that traffic between CF and your EB instance will be http only, unless you also setup your own SSL cert (not from ACM) on the instances (point 3).

  3. Install your own SSL certificate (not from ACM) directly on the EB instance, using nginx. This requires manual setup and a valid public certificate. Popular choice is LetsEncrypt, to get the SSL cert from.

like image 172
Marcin Avatar answered Oct 21 '22 05:10

Marcin