NGINX proxy on ECS - Address already in use. How to do a dynamic port assignment to ALB and Security groups?

0

Hello,

I am facing an issue when running NGINX as a proxy service with two tasks - they seem to be fighting over one port (nginx: [emerg] bind() to 0.0.0.0:8999 failed (98: Address in use)), which can be easily resolved by only having only one replica. Now, I am curious how I would approach this problem if I wanted more replicas which are being load balanced by the ALB. Setting a dynamic port 0 means that there is a big chance that the Security Group will deny access to it, as only a few ranges are allowed.

pbocan
preguntada hace 7 meses289 visualizaciones
1 Respuesta
0

Hello.

Running multiple instances (tasks) of a service on a single host in Amazon ECS can certainly lead to port conflicts if not configured appropriately, especially when you're dealing with standard HTTP/S ports. If you’re running NGINX as a reverse proxy in ECS, here's how you might handle dynamic port mappings, while still ensuring compatibility with the Application Load Balancer (ALB) and security groups.

Regards, Andrii

profile picture
EXPERTO
respondido hace 7 meses
  • Hey Andrii, are you missing a link in the answer?

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