ECS Fargate service with load balancer not working

0

I have been stuck on this for 3 days. I have a fargate service running in ECS. It is running a gunicorn app on port 80. I can see from the logs, the server starts:

[2023-04-04 20:51:39 +0000] [1] [INFO] Listening at: http://0.0.0.0:80 (1)

I have a load balancer, listening at port 80 with a target group. My issue is I cannot seem to access to load balancer. Get the following:

<!doctype html>
<html lang=en>
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.</p>

I can confirm that:

  1. My load balancer is exposed to the internet.
  2. My security group for ECS has inbound rule to allow traffic from my load balancer.

I must have tried about 15 times. I cannot seem to make it work.

preguntada hace un año658 visualizaciones
1 Respuesta
1
Respuesta aceptada

I believe that given that the http "404" error is an application error is not related to load balancer or other network configuration. If you are getting 404 error you are actually reaching the application, however the application do have the web page you are trying to display. My suggestion is to double check your docker image configuration, you are probably having some issue on how you build you image.

To make the debugging faster, you could run the container in your local environment, login into your container and verify that you are getting the same error performing the same API call. For example:

wget http://localhost:80

If you are getting the same error is going to be clear that the issue is within the docker image itself

AWS
respondido hace un año
profile picture
EXPERTO
revisado hace 9 meses
profile pictureAWS
EXPERTO
revisado hace un año

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas