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

asked 4 months ago295 views
1 Answer
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
EXPERT
answered 4 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions