swarm-ingress-router icon indicating copy to clipboard operation
swarm-ingress-router copied to clipboard

Multiple DNS names

Open patrickbaber opened this issue 7 years ago • 15 comments

It would be nice to define multiple DNS names, e.g. example.com & example.org.

jwilder/nginx-proxy uses commas to separate multiple values. Maybe this is an option: ingress.dnsname=example.com,example.org.

patrickbaber avatar Sep 18 '16 16:09 patrickbaber

Good idea, I don't think that would be too hard to implement either.

tpbowden avatar Sep 18 '16 16:09 tpbowden

Needs more work as this seemed to introduce some instability.

tpbowden avatar Sep 20 '16 11:09 tpbowden

+1

mysite.com, www.mysite.com, https://mysite.com, https://www.mysite.com

pascalandy avatar Sep 20 '16 16:09 pascalandy

+1 for above @pascalandy

subhashdasyam avatar Oct 18 '16 05:10 subhashdasyam

OK, I'm still looking into a nice way to implement this. It would be easy to create using extra DNS names with a single certificate, which is fine if you can use alternate names with your certificates. If you want to use www.example.com, something.example.com and example.com where something.example.com has a different certificate however, then it becomes a lot more complicated.

tpbowden avatar Oct 18 '16 08:10 tpbowden

One certificate with alternative common names is fine, but extra DNS names like www.example.com and example.com are a must-have. Big Thanks!

patrickbaber avatar Oct 18 '16 12:10 patrickbaber

@tpbowden does this work with subdomain like xxxx.subdomain.com ?

i have issue, its not able to resolve it

subhashdasyam avatar Oct 20 '16 05:10 subhashdasyam

It currently works with any resolvable DNS name, it uses the hostname to decide which service to load but currently only allows 1 hostname per service.

tpbowden avatar Oct 20 '16 09:10 tpbowden

@tpbowden thanks for the reply :) I appreciate it I don't know if i am doing this correct but this isn't working for subdomain do i need to insert the subdomain info in /etc/hosts in all the nodes ? or is it required actually ?

I used below command

i have three manager nodes and 12 worker nodes total

in the Manager which is leader i am issuing the below command (after creating routers and things)

docker service create --name cis-test --constraint 'node.role != manager' --label ingress=true --label ingress.dnsname=cis-test.xxxxxx.com --label ingress.targetport=80 --network frontends nginx:stab le-alpine

but the page isn't resolving when i open browser and give this address cis-test.xxxxxx.com

can you please help me

Thanks in advance

subhashdasyam avatar Oct 20 '16 10:10 subhashdasyam

You should only need the hosts entry pointing to the IP of any of your nodes on the machine you are making the request from. What error are you seeing in the browser?

tpbowden avatar Oct 20 '16 10:10 tpbowden

@tpbowden

Finally!! i got it working :) well it seems i need to specify --publish :80 for nginx:stable-alpine << image else it isn't working the browser doesn't even load.

Thanks @tpbowden its finally working :D Thanks for your hard work

subhashdasyam avatar Oct 20 '16 10:10 subhashdasyam

That doesn't seem right - the router service should be on the same network as nginx so no ports need to be published by your services.

tpbowden avatar Oct 20 '16 12:10 tpbowden

umm weird but without publishing this isn't working for me atleast

subhashdasyam avatar Oct 20 '16 12:10 subhashdasyam

What's your docker version? will try to reproduce

tpbowden avatar Oct 20 '16 13:10 tpbowden

OS: CentOS-7

[sdasyam@manager1 sdasyam]# docker version Client: Version: 1.12.2 API version: 1.24 Go version: go1.6.3 Git commit: bb80604 Built: OS/Arch: linux/amd64

Server: Version: 1.12.2 API version: 1.24 Go version: go1.6.3 Git commit: bb80604 Built: OS/Arch: linux/amd64

[sdasyam@manager1 sdasyam]# docker node ls ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS 0d49wiumo84drezsrdzbb4o1g worker1_london Ready Active 2kt2uarhwbr3a7qef42wd6rgb manager3_germany Ready Active Reachable 4ymk50y5drjfsmrku4texashpqun worker3_texas Ready Active 5mrv2uspn3c77lzownmrefg8q worker4_london Ready Active 7ejb9k01w40jt1310pea2rgb9 worker4_texas Ready Active 905a1vwsqfc0gkmqb7huqlo4x worker2_germany Ready Active a5fptyzpkbygmlxi48kv3xvu9 worker3_london Ready Active aiyj11lvn1jzop9m4r2t83147 * manager1_london Ready Active Reachable b70vrjg6lxcuvux9rt2exyjgs manager2_texas Ready Active Leader bdgbiwt2pw0ckoe7yfdezvpes worker3_germany Ready Active c6nxnafdf4cmdupzk1f7vqgee worker1_germany Ready Active caibw8hnnlugav4ea4644ruws worker1_texas Ready Active cq5c6sls8btdqj6ijzlkz8unj worker2_texas Ready Active dorlqx5m7rdi9texas4jq378tvy4 worker2_london Ready Active ezmjh8ga0r9y6dpktolkhtyfj worker4_germany Ready Active

subhashdasyam avatar Oct 20 '16 13:10 subhashdasyam