EsseTi
EsseTi

Reputation: 4271

Application ELB forward HTTP to HTTPS

It's quite a common problem but I can't figure out how to solve it and why the Application Load Balancing does not have an option for it.

I've an Application ELB set for the ECS and listening on 80 and 443, now, i would like to forward all the HTTP calls to HTTPS . What's the way? beacuse in the rules the only thing that I can do is to forward to instances. Do I've to deploy a Container just to do the fowarding? Do I need another ELB (network maybe) to forward HTTP to HTTPS?

Upvotes: 0

Views: 809

Answers (2)

aka
aka

Reputation: 41

I had the same problem and I did ALB balancer with two target groups

first group with 80 port

and second with 443 port

both http

then I did http and https listeners in ALB which point to those goups

http listener -> target group port 80

https listener -> target group port 443

autoscaling instance should be atached to both target groups

and in target group with port 80 I did redirect rules to https

Upvotes: 0

Ashan
Ashan

Reputation: 19728

You cannot forward from HTTP to HTTPS using ALB. For this, you either need to do it using a proxy container or at the Web server in the application container.

If you are using AWS Cloudfront in front of your web application to cache the content, you can do the redirection there as well.

Upvotes: 1

Related Questions