[GH-ISSUE #96] Proxy to other docker containers #85

Closed
opened 2026-02-26 05:34:17 +03:00 by kerem · 1 comment
Owner

Originally created by @jrichet on GitHub (Mar 6, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/96

How do I connect to other docker containers?

I've tried connecting to localhost/127.0.0.1 on an alternate port exposed in those containers, but no joy. Is there a trick I'm not aware of?

I keep getting a 502.

It would be super helpful if the documentation included some troubleshooting tips

Originally created by @jrichet on GitHub (Mar 6, 2019). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/96 How do I connect to other docker containers? I've tried connecting to localhost/127.0.0.1 on an alternate port exposed in those containers, but no joy. Is there a trick I'm not aware of? I keep getting a 502. It would be super helpful if the documentation included some troubleshooting tips
kerem 2026-02-26 05:34:17 +03:00
Author
Owner

@jc21 commented on GitHub (Mar 6, 2019):

I assume you're running your NPM docker image in bridge mode, which is the default. In this mode 127.0.0.1 only connects back to the NPM docker image network stack, not the host machine.

You have 3 options:

  1. Run NPM in host mode.
  2. Add your other services to the bridge network stack: add them as services in the docker-compose.yml file and connect to them using the service name as the hostname.
  3. Connect to your other services by the machine's host IP address on the local network, ie: 192.168.1.50.
<!-- gh-comment-id:470323470 --> @jc21 commented on GitHub (Mar 6, 2019): I assume you're running your NPM docker image in `bridge` mode, which is the default. In this mode `127.0.0.1` only connects back to the NPM docker image network stack, not the host machine. You have 3 options: 1. Run NPM in [`host` mode](https://docs.docker.com/network/host/). 2. Add your other services to the bridge network stack: add them as services in the `docker-compose.yml` file and connect to them using the service name as the hostname. 3. Connect to your other services by the machine's host IP address on the local network, ie: 192.168.1.50.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#85
No description provided.