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

posta 5 mesi fa312 visualizzazioni
1 Risposta
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
ESPERTO
con risposta 5 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande