Single Instance Elastic Beanstalk Node App. HTTPS

2019-08-28 05:47发布

问题:

I have deployed a node.js app to Elastic Beanstalk. When I try to access the page via HTTP: everything works fine. when I try to access via HTTPS: I get a refused to connect error. I have followed the instructions on

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/https-singleinstance-nodejs.html

I created a .ebextensions folder and my https-instance-single.config looks like:

Resources:
  sslSecurityGroupIngress: 
    Type: AWS::EC2::SecurityGroupIngress
    Properties:
      GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]}
      IpProtocol: tcp
      ToPort: 443
      FromPort: 443
      CidrIp: 0.0.0.0/0

I have uploaded and deployed the new zip file with these included and still the same thing. I can access via HTTP but not via HTTPS.

Any help would be greatly appreciated.

回答1:

I would suggest you use LetsEncrypt for Elastic Beanstalk single instance. According to your current configuration, its only open port 443 to serve HTTPS but you are not pointing to certificate. This is the tutorial for LetsEncrypt SSL on Elastic Beanstalk: https://www.tutcodex.com/ssl-on-single-instance-elastic-beanstalk-tutorial/