Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

368
Views
Aws ec2 - how to setup load balancer to match docker container on ec2 instance

Background
I am having an EC2 instance, and a docker container running on port 3030.

In my docker container, there is a nodejs server which contain REST api setting.

I just create an Application Load Balancer with a target group(HTTP: 80) which points to above ec2 instance, in order to setup public http endpoint to send api request

The DNS name of the Load Balancer is my-docker-test-server-dev-123456789.ap-southeast-1.elb.amazonaws.com.

Problem
I tried to send http request POST https://my-docker-test-server-dev-123456789.ap-southeast-1.elb.amazonaws.com/login
in order to try the login api on Postman, but error occurs

HTTP 504: Gateway timeout

Update
I am using default security group for my load balancer.

Inbound Rule

Type Protocol Port range Source Description - optional
All traffic All All 0.0.0.0/0   –
All traffic All All ::/0    –
All traffic All All sg-d987a2bc / default   –

Update 2
Now updated the target group to point to HTTP:3030 as suggested by comment, but still same errors.

Health Check for the group:

unhealthy
Request timed out

Update 3
EC2 Instnace > Security

Inbound Rule

Port range Protocol   Source      Security groups
22          TCP      0.0.0.0/0    launch-wizard-9

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Based on the comments.

The issue was by incorrectly set security group (SG) of the instances and the target group (TG) port. In the first case, since the docker application is exposed on the port 3030 on the instance, SG must allow inbound traffic on that port. The inbound SG rule was missing.

In the TG case, the original traffic port was 80. However, since the docker works at port 3030, TG port needed to be change to port 3030.

So the traffic looks as follows:

Clinet ---(HTTP:80) ---> ALB ---> TG --- (HTTP:3030) ---> Instance with docker on port 3030
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!