madwire/dockercloud-nginx-proxy

Cannot get this to work.

abdavid opened this issue · 3 comments

Hi!

I have been trying to get this nginx-proxy up and running for a couple of days now, and I am not certain what I am missing.

The setup consists two services currently on the same node.

When I redeploy my other service I can see from the nginx service logs that it receives the events and reinitialises and rebuilds the nginx configuration. But from what I can see in the logs it only recognizes the nginx service itself and does not build a configuration for service that actually just redeployed.

Mind you that I have tried this setup on different nodes and on the same node and the result is the same. I did of course specify the VIRTUAL_HOST environment variable on the service i wish to proxy to, and my other service is listening on port 80, but the port is not published.

So currently I gathered one of two possibilities for this not working.

  1. Networking
  2. Bug due to api changes in docker cloud.

Hope you could point me in the right direction or give me some genereal direction to where I should start debugging.

Dump of the nginx service logs:

dockercloud.1 | I, [2018-03-09T12:35:26.255388 #11] INFO -- : Init Nginx config
dockercloud.1 | I, [2018-03-09T12:35:29.653237 #11] INFO -- : dockercloud-nginx-proxy-ab65de63: ["10.7.0.3"]
dockercloud.1 | I, [2018-03-09T12:35:29.656725 #11] INFO -- : Connecting to wss://ws.cloud.docker.com/api/audit/v1/events
dockercloud.1 | 2018/03/09 12:35:29 [notice] 25#25: signal process started
dockercloud.1 | I, [2018-03-09T12:35:30.081335 #11] INFO -- : Connected!
dockercloud.1 | I, [2018-03-09T12:35:55.174832 #11] INFO -- : Service: - is Redeploying...
dockercloud.1 | I, [2018-03-09T12:36:12.257614 #11] INFO -- : Service: - is Running!
dockercloud.1 | I, [2018-03-09T12:36:20.890809 #11] INFO -- : dockercloud-nginx-proxy-ab65de63: ["10.7.0.3"]
dockercloud.1 | I, [2018-03-09T12:36:20.891694 #11] INFO -- : Writing new nginx config
dockercloud.1 | I, [2018-03-09T12:36:23.895399 #11] INFO -- : Reloding Nginx...
dockercloud.1 | 2018/03/09 12:36:23 [notice] 34#34: signal process started

Ok I have gotten a little bit futher. Publishing port 80 on the service seems to have made it discoverable from the nginx-service point of view - but now I am getting

2018/03/09 14:49:18 [error] 37#37: *62 connect() failed (113: No route to host) while connecting to upstream, client: xx.xxx.xxxx.xx, server: ----- request: "GET /favicon.ico HTTP/1.1", upstream: "http://10.7.0.9:80/favicon.ico", host: "-------", referrer: "-------"

To I have gotten past the initial issue, but now it seems like the weave network is not doing what I think it is doing.

My services are all on 10.7.0.0/16 subnet and I can see that my services are listed as being on 10.7.0.2/16 and 10.7.0.9/16 respectively but the cannot communicate with each other.. I am gonna take this on to the docker forums.

You should btw update your documentation and use the same phrasing as docker cloud uses when it comes to exposed/published ports.

@abdavid Sorry to see that your having issues getting setup, Not sure I have seen a weave network issue across hosts before on DockerCloud.

I must admit that I have been holding off doing any work on this project until Docker have detailed there intentions with the DockerCloud product which has not been updated in a while.

For a bit of context, this is how my setup looks like (using docker cloud stackfiles). Hope this helps.

Stack/Service LB/Proxy:

lb:
  deployment_strategy: every_node
  image: 'madwire/dockercloud-nginx-proxy:latest'
  ports:
    - '80:80'
    - '443:443'
  restart: always
  roles:
    - global
  tags:
    - lb

Stack/Service App1:

my-app:
  environment:
    - VIRTUAL_HOST=example.com www.example.com
    - FORCE_SSL=true
  expose:
    - '80'
  image: 'my_image:latest'

Stack/Service App2:

my-app2:
  environment:
    - VIRTUAL_HOST=example2.com www.example2.com
    - FORCE_SSL=true
  expose:
    - '80'
  image: 'my_image:latest'

Thanks for replying @madwire.

I tried replicating your setup with my own images and your proxy and it is unfortunately still not working.

Are you using which provider are you using for your nodes? I am starting to think that it might be related to that if your current setup is running just fine with similar stacks like you described above.