Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

498
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!