Docker Community Forums

Share and learn in the Docker community.

Nginx and Docker 18.09.1

ucp
(Fsejoseph) #1

Hello! I am trying to deploy Rocket.Chat in Docker 18.09.1 UCP 3.1.2 env. I am deploying in a stack. I wrote the compose file and run it in other envs before with no issues. In the compose file I am using nginx(reverse proxy), rocket.chat, and mongodb images. When I run the stack all services go green but website does not work. When I go into the nginx container and type nginx I get this error

[emerg] bind() to 0.0.0.0_8443 failed (98_ Address in use)

which does not make sense to me. Has anyone else had this issue. I am using layer 7.

I am running the nginx:apline docker image in Docker 18.09.1, UCP 3.1.2. I am trying to deploy Rocket.Chat. My compose has nginx(reverse proxy), rocket.chat, mongodb. When I deploy the compose all services go green. I am running all of these commands inside nginx container and the status is active / green.
When run nginx i get

nginx: [emerg] bind() to 0.0.0.0:443 failed (98: Address in use) ```

When I run nginx -t i get 
```/ # nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful```

When I run netstat -tulpn i get
```/ # netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.11:33291        0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      1/nginx: master pro
udp        0      0 127.0.0.11:46370        0.0.0.0:*                           -```
Why am I having this issue? I have never ran into this issue. 
(Fsejoseph) #2

Solution: I was putting the incorrect port in com.docker.lb.port. Since, nginx uses 443 in the config file that is how docker communicates with the container. I thought I tried it before and it did not work until i showed someone haha