-
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
docker ip is not generated in the /etc/nginx/conf.d/default.conf file #380
Comments
nginx-proxy doesn't support overlay-networks yet (which are used by docker-compose v1.6.0), there is the ongoing PR #337 which tries to solve this issue. For the time being, you will have to use docker-compose with version-spec 1. |
But shouldn't it work if both proxy and containers are running in the same network ? Sent from my iPhone
|
Unfortunately not. #337 has to be merged for user-defined networks to work. |
I'm getting the same result when not using overlay like so starting a jenkins container
>> docker logs nginxg-rproxy
forego | starting nginx.1 on port 5000
forego | starting dockergen.1 on port 5100
dockergen.1 | 2016/03/14 06:52:43 Generated '/etc/nginx/conf.d/default.conf' from 2 containers
dockergen.1 | 2016/03/14 06:52:44 Watching docker events
dockergen.1 | 2016/03/14 06:52:55 Received event die for container 12cbaf338a79
dockergen.1 | 2016/03/14 06:52:56 Generated '/etc/nginx/conf.d/default.conf' from 1 containers
dockergen.1 | 2016/03/14 06:52:56 Running 'nginx -s reload'
dockergen.1 | 2016/03/14 06:57:04 Received event start for container d3c08ae53245
dockergen.1 | 2016/03/14 06:57:04 Generated '/etc/nginx/conf.d/default.conf' from 2 containers
dockergen.1 | 2016/03/14 06:57:04 Running 'nginx -s reload' docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d3c08ae53245 jenkins "/bin/tini -- /usr/lo" 12 minutes ago Up 12 minutes 0.0.0.0:8080->8080/tcp, 0.0.0.0:50000->50000/tcp jenkins
52d727789549 jwilder/nginx-proxy "/app/docker-entrypoi" 16 minutes ago Up 16 minutes 0.0.0.0:80->80/tcp, 443/tcp nginxg-rproxy >> docker exec nginxg-rproxy cat /etc/nginx/conf.d/default.conf
upstream jenkins.dev {
# jenkins
server 172.17.0.3 down;
}
server {
server_name jenkins.dev;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
proxy_pass http://jenkins.dev;
}
} Any idea why? |
This:
is not the same result as this:
Your issue now is that you have published ports 8080 and 50000 on your Jenkins container, and nginx-proxy doesn't know which one to use. You need to specifiy this in the environment variable
See Multiple Ports for more information. |
Resolved by previous comment, closing. |
I started the proxy container using the following command
docker run -d -p 80:80 --net=node_default --name proxy -v /var/run/docker.sock:/tmp/docker.sock -t jwilder/nginx-proxy
I started a simple node container
my docker-compose file
here is what was generated in the /etc/nginx/conf.d/default.conf file
upstream myapp1.dev { # node_worker_1 server :3000; } server { server_name myapp1.dev; listen 80 ; access_log /var/log/nginx/access.log vhost; location / { proxy_pass http://myapp1.dev; } }
the container ip is missing.
any idea why?
The text was updated successfully, but these errors were encountered: