Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

369
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda