Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

491
Visualizações
docker nginx-proxy: How to "curl" from one container to another?

I have a set of Docker containers which right now uses a php-fpm image to host one app, and an nginx container which right now provides access to that one app. I have a third container which periodically uses curl to strobe a URL within that container. This command right now uses the hostname nginx. (The image is based on alpine:latest ...)

/usr/bin/curl --silent -i http://nginx/secret_url ...

Now, I want to use nginx_proxy to allow me to run more than one application container. But, now, how will the curl commands know how to send the request via the nginx_proxy to the proper application-container? How would there be name-resolution?

... or, does it matter? If curl simply issues a request on the internal Docker network (shared by nginx_proxy) attempting to connect to "port 80," and it specifies whatever URL it chooses, will the request nonetheless arrive at the proxy, which is then responsible for resolving the virtualhost name ... which I know that it will do ...? What I'm wondering is how the curl request is actually going to get to the web-server. Am I simply confusing myself?

Is it, for example, the case that the nginx in the URL cited above could actually be anything?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I wound up specifying the IPV4_ADDRESS of the nginx-proxy container (within the Docker bridged-network), then specifying this in an /etc/hosts file which I uploaded to the cronjob container.

It is important that, whereas the /etc/hosts in the container-host environment should probably specify 127.0.0.1, that will not work in a container. The container sees only "its" network, and so from its point-of-view 127.0.0.1 would refer literally to the container itself.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda