Nginx-proxy: Setup with Swarm Using Docker 1.12.x

Created on 21 Feb 2017  路  3Comments  路  Source: nginx-proxy/nginx-proxy

My Docker Version :

Client:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 21:44:32 2016
 OS/Arch:      linux/amd64

Server:
 Version:      1.12.3
 API version:  1.24
 Go version:   go1.6.3
 Git commit:   6b644ec
 Built:        Wed Oct 26 21:44:32 2016
 OS/Arch:      linux/amd64

I'm Using Swarm across 2 Machines
, and i deploy this jwilder/nginx-proxy using this command :

docker service create --mode global --name proxy -p 80:80 --network backend \
 --mount type=bind,source=/var/run/docker.sock,destination=/tmp/docker.sock,readonly \
 --mount type=bind,source=/mnt,destination=/etc/nginx/conf.d jwilder/nginx-proxy

and it's working great, every i create a service using "VIRTUAL_HOST"
because the nginx-proxy installed as global (installed on every swarm node) need to share the
configuration of /etc/nginx/conf.d/default.conf over swarm node,
i already solve it using GlusterFS . but there are following issues,
every this nginx-proxy spawned, this is executing docker-gen and overwrite /etc/nginx/conf.d/default.conf to default, and wipe out the existing configuration .

and i try to build using this Dockerfile , but when i run the result image . nothing happened, there are no log or error, just exited after i run it. am i missing something?

Thank you

Most helpful comment

nginx-proxy is not designed to work with Swarm. The Traefik project would do what you want.

All 3 comments

nginx-proxy is not designed to work with Swarm. The Traefik project would do what you want.

@thomasleveil Traefik is not totally the solution... Currently no http to https redirection per container. If you activate http to https redirection, it happens for all container. Moreover the http status code returned is 302, instead of 301...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevindesousa picture kevindesousa  路  3Comments

lagivan picture lagivan  路  3Comments

strech345 picture strech345  路  4Comments

etiennemtl picture etiennemtl  路  3Comments

cadesalaberry picture cadesalaberry  路  3Comments