mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 09:25:55 +03:00
[GH-ISSUE #203] Can't communicate by name on docker network #180
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#180
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jfrancais on GitHub (Sep 23, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/203
I currently have this setup in a user defined docker network, "dockerwp". In that network I have several other docker containers running as backend. I have setup npm and have created several proxy hosts to point to the backened containers, again in that dockerwp network. If I set npm to talk to them by name (ie http://website1) it can't communicate. If I use the same settings and put use the internal ip address of that container (ie 172.21.0.6) everything communicates as expected. Since I'm spinning up and removing containers quite regularly I'm, wasting a lot of time looking up the IP, it would be nice to be able to communicate by name, which should be possible on a user defined network.
@beloniki commented on GitHub (Sep 24, 2019):
Can you communicate to other containers from inside the npm container?
@jfrancais commented on GitHub (Sep 24, 2019):
Yes. For example, it I do:
docker exec -it NPMCONTAINER /bin/bash
I can then ping both the IP 172.21.0.6 and website1
I can curl both the IP http://172.21.0.6 and http://website1
Using the web interface, if I set up a proxy host to point to http://172.21.0.6 on 80 it works, but if I set up http://website1 on 80 it does not. (I get a 502 Bad Gateway message)
@beloniki commented on GitHub (Sep 25, 2019):
Do you see 502 error in npm logs? If you do, attach this log here, please.
Maybe this error is from the backend?
@jfrancais commented on GitHub (Sep 25, 2019):
[20/Sep/2019:21:44:08 +0000] - - 502 - GET https MY.PROXY.HOST "/" [Client ##.##.##.## [Length 150] [Gzip -] [Sent-to website1] "curl/7.61.1" "-"
This is in my error log, I have changed the domain I'm using to MY.PROXY.HOST and changed my ip address.
@beloniki commented on GitHub (Sep 26, 2019):
Ok, try to find what happens at this time [20/Sep/2019:21:44:08 +0000] in error.log, or find events where the website1 participates. I think this may help to find out the cause.
@jfrancais commented on GitHub (Sep 26, 2019):
After reviewing all the logs, I see the issue. My container name is "Wordpress1". It has an uppercase W. In NPM, it is entered as "Wordpress1", also with uppercase W. When I reviewed the logs I see it was using "wordpress1" lowercase W. So NPM is not using the case for the transfer host as entered, it lowercases it. And the container name is case sensitive. I verified this by destroying the container and recreating it with lowercase w and it started working.
So my interm fix is to name my containers all lowercase, but I think that the function that lower cases the forward host should be addressed.
@beloniki commented on GitHub (Sep 30, 2019):
Good research.
@Mechazawa commented on GitHub (Nov 28, 2020):
Adding
resolver 127.0.0.11;to the proxy config fixes this issue@chaptergy commented on GitHub (May 11, 2021):
See https://github.com/jc21/nginx-proxy-manager/pull/745#issuecomment-753558427