Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

495
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda