-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nginx.conf does not get updated with overlay network IPs #304
Comments
Related issue: #97 |
This could be related to the new networking in docker, where a container can be attached to multiple networks. Only the default "bridge" networking propagates the old fields for IP-address of the container, but custom networks will not, and the IP address is returned in a nested list, see nginx-proxy/docker-gen#129 |
@thaJeztah Thank you for the feedback. I am not a go-programmer (yet), but I looked a bit through the code and played around with So it looks to me, that we first need support of the new networking feature from I thought about an additional ENV variable like |
@thaJeztah @jwilder @md5 Some updates from my side.
My plan would be to connect the reverseproxy to all So .. would love to hear some thoughts from your side about this. |
@schmunk42 That looks like a great start. Glad to see that the necessary changes have landed in As for the changes to the |
I played around with it a little bit more today... Here's another approach without any changes to
This is the changed section The glitch at the moment is, that we have to connect the proxy to the app-network before we start it, otherwise we get an error (host not found). @md5 But in general that goes in the same direction as you mentioned - swarm handling can be consolidated. |
And I think we need to wait for the fix here docker-archive/classicswarm#1402 first |
@schmunk42 would your earlier suggestions nginx-proxy/docker-gen@fdf2922 fix |
I haven't continued working on the PR, because I found the above solution without changing the image. See above, for the first lines from our modified If a container is started with This works fine in conjunction with Any thoughts about this? Do we need the these changes in the PR at all? [update] removed duplicated code You could give the above template a try with local docker networking, I at least can't remember having problems with it. |
This should work automatically without an extra env var to be specified. Isn't the type of networking available via the container info? Though it probably requires knowing if the proxy container is on the same network as the app container … |
@fbender I don't think the preferred networking type is specified in the container info. The container will have I haven't fully thought through this, but I think that instead of a |
This sounds like a good approach to me. It would allow other networks that are used by the proxied container to remain inaccessible to the nginx-proxy container, which I think is useful. |
Same issue with Docker 1.10 and Docker Compose 1.6. Missing IP address in upstream block. Using default network. Compose config version 2. |
Yeh I just run into this too, same as @Ant59, it seems both the proxy and any webapp need starting in the singular way, with docker run rather than with docker-compose |
Not using Compose isn't an option for me. For some reason, docker-gen is no longer able to determine the IP address of the container when started using Compose. |
@Ant59 the problem is that nginx-proxy does not yet support the new docker networking feature that docker compose version 2 uses. Try to use the previous compose config format instead. |
Perfect. Older Compose config works. Thanks. |
@wader thank yooooou. I wasted a few hours on this silly issue. Really needs to be mention in the README. |
@meyer no probleeeem 😄 |
Didn't know that this is a confirmed issue. Should've searched better!
|
I am now also using the following declaration to get working results:
|
So is there any temporary solution to make |
….yml is ported back to version 1
….yml is ported back to version 1
….yml is ported back to version 1
For local dev
just change default.conf to
|
If #425 is merged, is this issue resolved? |
Hi, Just ran into the same issue as the OP with the latest version of all containers, but only when using a decoupled version of Hope it helps. |
Hi @mickaelperrin , thanks for the example repo. I learned a new way to organize my services/networks. |
👍 same problem here with docker 1.10 and latest nginx-proxy |
I've tested the changes from #425 and it works like a charm xD nginx-proxy |
@Nepoxx looks like this has not beed published on docker hub yet |
…ose.prod.yml is ported back to version 1" This reverts commit 0b2cfa5.
…ose.prod.yml is ported back to version 1" This reverts commit 0b2cfa5.
Any news on this? Or do you plan to integrate #425 at all? |
The |
…ose.prod.yml is ported back to version 1" This reverts commit 0b2cfa5.
@mickaelperrin did you solve it? I am using nginx,nginx-gen and companion and I have no host... |
my compose file looks like this: version: "3.1"
services:
app:
image: registry.gitlab.com/arefaslani/influencer-marketing-platform
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/usr/src/app
ports:
- 3000:3000
environment:
- VIRTUAL_HOST=api.myapp.dev
nginx:
image: jwilder/nginx-proxy:alpine
ports:
- 80:80
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
- app
when I deploy the stack using
According to |
I created an overlay-network for my swarm and can ping and wget a hello-world webserver in the swarm from the reverseproxy container.
This is my
/etc/hosts
And this the relevant part of
nginx.conf
As you can see the IP is missing.
Looks like somewhere around here the IP does not get written correctly.
Any idea how to fix this or is this an issue with
docker-gen
?Tested on:
docker 1.9.1, docker-compose 1.5.1
The text was updated successfully, but these errors were encountered: