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
已提问 7 个月前289 查看次数
1 回答
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
专家
已回答 7 个月前
  • Hey Andrii, are you missing a link in the answer?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则