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.

1 Antwort
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
EXPERTE
beantwortet vor 7 Monaten
  • Hey Andrii, are you missing a link in the answer?

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen