container host name resolve for proxy_pass in ecs

0

I am running application on aws ecs cluster EC2 instance type with default network mode and custom hostname are mentioned in task definitions. Alb target to nginx, nginx will do proxy_pass to containers. But it could not route traffic to other container based on URL.for local docker we do create custom network and assign --network to containers which communicate with other container with this custom network. Question is how can i do this custom networking to proxy_pass to other containers based on path

質問済み 5ヶ月前312ビュー
1回答
1

Hello.

For communication using bridge mode, you should be able to communicate using the container name by setting "links" in the task definition.
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html

The link parameter allows containers to communicate with each other without the need for port mappings. This parameter is only supported if the network mode of a task definition is set to bridge. The name:internalName construct is analogous to name:alias in Docker links. Up to 255 letters (uppercase and lowercase), numbers, hyphens, and underscores are allowed. For more information about linking Docker containers, see https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/. This parameter maps to Links in the Create a container section of the Docker Remote API and the --link option to docker run.

profile picture
エキスパート
回答済み 5ヶ月前

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

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

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

関連するコンテンツ