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?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南