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

gefragt vor 5 Monaten312 Aufrufe
1 Antwort
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
EXPERTE
beantwortet vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen