Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I terminate HTTPS traffic to elb and the container is running HTTP (fargate)

I want to create the next schema: client—HTTPS (aws load balancer)—fargate container runninng HTTP traffic. I want to terminate HTTPS session with load balancer istead of having expensive SSL certificates in docker container.It is possible for some redirection with aws to handle HTTPS traffic via Internet but in container service to listen for pure HTTP?

I have tried cert bot but for me it is not the right decision.

The schema I need to implement is this: client – HTTPS – elb—HTTP – fargate

like image 321
VEI Avatar asked Nov 28 '25 09:11

VEI


1 Answers

I rose a ticket to the aws support and they proposed :

  • Navigated to the EC2 console > Select Load Balancer > Listeners > Add Listener > Choose protocol HTTPS and port 443; in Default actions, Add Action, Redirect To "#{protocol}" and Port 80, leave remaining configuration as it is.

  • Next, on the same page, in Default SSL certificate, choose the SSL certificate that I created for the Route53 domain.

  • Saved!

  • Navigated to the ECS console, ensured that the container defined in Task Definition is running on Port 80.

  • Next, created a Cluster, created a Service in the same VPC in which my Application Load Balancer resides.

  • While configuring the Service, I selected my ALB, and in the 'Container to Load Balance' section, I added the following configurations:

  • Production Listener Port 443:HTTPS

  • Production Listener Protocol HTTPS

  • Target Group Name - Create New

  • Target Group Protocol - HTTP (Since our Fargate container is listening on Port 80)

  • Path Pattern /

  • Evaluation order 1

  • HealthCheck Path /

  • Created the Service.

like image 111
VEI Avatar answered Dec 01 '25 09:12

VEI



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!