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回答
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?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ