Post ASKeZP7jeWmlypEnDM by dneary@mastodon.ie
 (DIR) More posts by dneary@mastodon.ie
 (DIR) Post #ASKeZJv8zuk7qKJAOW by dneary@mastodon.ie
       2023-02-04T00:07:06Z
       
       0 likes, 0 repeats
       
       I am missing something dumb & obvious... I have a docker-compose, with nginx, mysql, wordpress+apache+php. The nginx maps localhost:8080 to its port 80. That works. The nginx config (default server) has a proxy_pass http://wordpress:80 - the service name resolves, but I get a "No route to host" error (quoted next):
       
 (DIR) Post #ASKeZKXQhZMrl4Dk4O by troed@masto.sangberg.se
       2023-02-04T09:50:23Z
       
       0 likes, 0 repeats
       
       @dneary Does the wordpress container map port 80? But it sounds like you need to be explicit which of its networks Nginx need to use when addressing Wordpress. That could be made implicit so somewhat surprising if so.
       
 (DIR) Post #ASKeZLjWG6dHSqsuYK by dneary@mastodon.ie
       2023-02-04T00:08:41Z
       
       0 likes, 0 repeats
       
       Full error:nginx_1      | 2023/02/03 23:50:21 [error] 20#20: *1 connect() failed (113: No route to host) while connecting to upstream, client: 192.168.32.1, server: example.com, request: "GET / HTTP/1.1", upstream: "http://192.168.16.3:80/", host: "localhost:8080"I don't understand why the client IP is on a different network to the upstream IP - nginx is on two Docker networks, do I need to configure something to ensure correct routing?
       
 (DIR) Post #ASKeZNSDrNz8nmo7s0 by dneary@mastodon.ie
       2023-02-04T00:17:17Z
       
       0 likes, 0 repeats
       
       Progress... I added the wordpress container to external_network and now the proxy request is passed through! I now have an error trying to connect to the database 🙂 Stopping for the night. Docker networking nuances has gotten the better of me - for now.
       
 (DIR) Post #ASKeZP7jeWmlypEnDM by dneary@mastodon.ie
       2023-02-04T01:36:30Z
       
       0 likes, 0 repeats
       
       I "fixed" it be putting everything on a single bridge network. How can I proxy_pass from an nginx RPC to a wordpress/Apache/MySQL worker bee, with a database on an internal bridge?