-
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
Unable to profixy a container started with docker-compose version 2 #502
Comments
Hi, have look at this comment #478 (comment). What is probably happening is that docker-gen knows about the container but there is no common network. This is a known bug... generated config should probably just skip it totally or generate something valid in |
Thanks Wader for the info, I had a look at the issue queue but did not opened this topic. So it's a known bug. |
#438 is kind of this issue but the comments is a bit messy because of a similar issue happening at the same time. |
See the issue: Problem with nginx.tmpl when using docker-compose based deployments. I believe that has the fix you need. Todd |
FYI: network_mode: "bridge" to your docker-compose.yml file. i.e. :
|
I had the same issues, and solved it by creating a network called nginx-proxy:
Then I added the following to the bottom of my docker-compose file:
Here is my complete docker-compose.yml:
|
That worked great for me - thanks @codekitchen-ws ! |
I had the same problem, and I added to my docker-compose file this line : network_mode: bridge Whatever is the I added this line in my gitlab docker-compose, it was the one who make crash the reverse proxy. |
We're also seeing this issue, when not everything is configured 100% correctly. Our config is pretty similar to #552 (comment) (setup with overlay networking + compose v2) As said before nginx-proxy should not create invalid configs, when the container is not reachable. Moreover I haven't found a way to run compose v1 stacks with the above configuration. The upstreams are also empty, I had the public IP in the upstream before. |
I added some more details about this issue and why it's happening here: #565 (comment) |
@briansrepo |
Is it possible that the network workaround is also needed with a plain Dockerfile, when not using compose and if so, how would I do that? I'm experiencing the same error without docker-compose. |
Hey there, I ran into a similar problem, which I could not solve with the solution posted by @briansrepo in August 2016. I want to run the nginx-proxy separately and then starting multiple compositions which all have another nginx running inside, mainly Laradocks. It seems that the nginx-proxy has problems to include a new container in the config file when running in a custom network AND the new container is started from a separate composition.
This does not work. I created the network, started the proxy first and then the app. Whenn adding the above mentioned Maybe someone has an idea about it. |
The above behavior only appears on my test server. I do not have issues running this setup local! Server: Local: |
Good day, i ran into another problem. When i start my first odoo:10.0 container with portainer stacks everything works fine:
also my nginx-proxy container is running in "mynet" network. But if i try to duplicate the docker-compose to this:
the nginx-proxy config said:
so its not possible to open up the container with my.2domain.com. its only reachable direct with http://IP:PORT Any ideas? |
@flocalhost should VIRTUAL_PORT in the second config really be 8070 not 8069? that is assuming the odoo:10 image will losten on 8069 |
youre absolutely right. thanks a lot. worked hours on that problem |
Resolved as per last comment. |
Hi,
I wanted to implement the nginx-proxy to serve several nginx servers so I followed the example on the homepage and it works fine. However, thing start being more complex when I try to implement it with my real servers. In short the nginx-proxy is up but web servers are not proxified and I can only see a 503 status code from the proxy.
Nginx-proxy is catching events and is generating the Nginx default configuration file every time I start or stop a container.
But when I start on of my container I can see the following error message.
I had a look at the Nginx-proxy Default configuration and found that the generated file had no information in it about the web server I wanted to proxify.
Has you can see there is nothing in the upstream section
I have done a lot of tests to understand what going on and finally found that problem only happens when I'm starting a container using docker-compose in version 2 because in other cases it works fine.
Here is a chunk of the Default Nginx file auto-generated
Here is the workflow I have done to reproduce it
The whoami_version-1/docker-compose.yml file
I have been able to reproduce it several time on my local machine. I'm using the mac beta of Docker
I think this issue a version a bit weird but I have not been able to find a better root cause.
Does anyone is able to reproduce ?
I have wrapped everything in a shell to help test easily. Unzip the archive and run startServers.sh
nginx_proxy_test.zip
The text was updated successfully, but these errors were encountered: