Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Terminate SSL on Application Load Balancer in front of Elastic Beanstalk

Ok, So I am very close to getting my Amazon generated SSL terminated on the ALB that is put in front of my web application which runs on Elastic Beanstalk.

What I have done so far is to add a file called alb-secure-listener.config to the .ebextensions folder in the root of my application directory, the content of this file is as follows:

option_settings:
    aws:elbv2:listener:443:
        DefaultProcess: https
        ListenerEnabled: 'true'
        Protocol: HTTPS
        SSLCertificateArns: arn:aws:acm:us-east-1:#############:certificate/####################################
    aws:elasticbeanstalk:environment:process:https:
        Port: '443'
        Protocol: HTTPS

Where the line with all the ###'s is replaced with my SSL ARN.

Now when I open https://mywebapp.com I get a "502 Bad Gateway" page instead of my webapp, that page - however - is secured by the SSL Certificate I want to use.

Opening http://mywebapp.com displays the site normally.

I guess there is an oversight somewhere, but I have yet to figure out what it is and if anyone has a clue please let me know :D

like image 406
lundzern Avatar asked Mar 05 '17 17:03

lundzern


1 Answers

You need to tell the ALB to communicate with the EC2 instances over HTTP on port 80. Change the last two lines to this:

Port: '80'
Protocol: HTTP
like image 112
Mark B Avatar answered Nov 14 '22 22:11

Mark B