0

I have two dockerized apps, each consisting of an nginx + php-fpm container sitting behind another nginx proxy container. Both apps I can access via a locally defined hostname, say domain-1.dev and domain-2.dev. Here's my hosts file:

10.0.75.1 domain-1.dev domain-2.dev

None of the containers are linked beyond defining the VIRTUAL_HOST=... env variable in each of the nginx containers as required by the jwilder/nginx-proxy image I'm using for the proxy:

https://github.com/jwilder/nginx-proxy

Therefore from a browser on the host I can access each of the domains and get served php files in their relevant php-fpm containers.

Question: what do I need to setup to be able to curl one domain from another, e.g. to curl domain-1.dev from within the php-fpm container of the domain-2.dev app?

At the moment I'm getting cURL error 7: Failed to connect to domain-2.dev port 80: Connection refused

8
  • Is your app listening on port 80 inside the container?
    – BMitch
    Feb 1, 2017 at 23:18
  • Yes, as I said, I can access both apps through a browser on the host. The nginx proxy container is exposing it's port 80 and forwarding the traffic to the relevant app by using the VIRTUAL_HOST config. Neither of the apps expose any ports.
    – David
    Feb 1, 2017 at 23:25
  • I understand that nginx is exposed on port 80, I'm asking about the port that is listening on domain-1.dev and domain-2.dev, is the app inside of those containers listening on port 80?
    – BMitch
    Feb 1, 2017 at 23:28
  • Got ya - yes, they are listening on 80 and 443. The PORTS section confirms 80/tcp, 443/tcp for both apps.
    – David
    Feb 1, 2017 at 23:34
  • From inside domain-1.dev, what ip does domain-2.dev resolve to, the docker host, nginx, or the other container?
    – BMitch
    Feb 1, 2017 at 23:37

0

You must log in to answer this question.

Browse other questions tagged .