nginx-proxy / nginx-proxy/nginx-proxy

Two servers : same docker-compose, different behaviour

Open
#650 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
19.9k
Forks
3k
Avg merge
2d 11h
Merged PRs (30d)
1

Description

Hi everyone,

I already created an issue on the rocketchat github at this address : https://github.com/RocketChat/Rocket.Chat/issues/5065 but I think that the issue come from the nginx more than the rocketchat itself.

First of all, I do not know very well the use of nginx and that's maybe why I'm using this very good container, trying not to learn too much about what makes me fear !

So I worked on a docker-compose which could help me to launch a certain amount of micro-services for my devops needs.

Here is the file : docker-compose.txt

The surprising fact is that this docker-compose doesn't react the same on two different servers.
The first server is the one I use with my colleagues and it's fully working ! The second one is the one I use with my classmates (I'm a working student in software development), and almost everything is working except the rocketchat.


I tried to put all needed informations in the description bellow :

My company composer (working configuration) :

Here is the conf of my company nginx, I pretty sure they are the same (I used npp compare plugin to check)...

company nginx conf :
upstream rocketchat.mycompany.tld {
                                ## Can be connect with "home_default" network
                        # home_rocketchat_1
                        server 172.18.0.3:80;
}
server {
        server_name rocketchat.mycompany.tld;
        listen 80 ;
        access_log /var/log/nginx/access.log vhost;
        return 301 https://$host$request_uri;
}
server {
        server_name rocketchat.mycompany.tld;
        listen 443 ssl http2 ;
        access_log /var/log/nginx/access.log vhost;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
        ssl_prefer_server_ciphers on;
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;
        ssl_certificate /etc/nginx/certs/rocketchat.mycompany.tld.crt;
        ssl_certificate_key /etc/nginx/certs/rocketchat.mycompany.tld.key;
        ssl_dhparam /etc/nginx/certs/rocketchat.mycompany.tld.dhparam.pem;
        add_header Strict-Transport-Security "max-age=31536000";
        include /etc/nginx/vhost.d/default;
        location / {
                proxy_pass http://rocketchat.mycompany.tld;
        }
}

But when I launch a telnet command from the nginx on 172.18.0.3:80, something is returned.

company telnet return :
# telnet 172.18.0.3 80
Trying 172.18.0.3...
Connected to 172.18.0.3.
Escape character is '^]'.
Here is the return of the command docker ps | grep rocket :

6a75067c9a4e rocketchat/rocket.chat "node main.js" 2 days ago Up 38 hours 3000/tcp, 0.0.0.0:32768->80/tcp home_rocketchat_1

So no port 3000 redirection and that's working well ! 👍


My own composer (not working configuration) :
Here is the return of the command docker ps | grep rocket :

ea32da4e1911 rocketchat/rocket.chat:latest "node main.js" 12 hours ago Up 12 hours 3000/tcp, 0.0.0.0:32802->80/tcp root_rocketchat_1

Here is the telnet result for my own server :

own server, telnet return :
Trying 172.18.0.7...
telnet: Unable to connect to remote host: Connection refused

Here is the conf of my classmates nginx :

own server nginx conf :
upstream chat.mydomain.tld {
                                ## Can be connect with "root_default" network
                        # root_rocketchat_1
                        server 172.18.0.7:80;
}
server {
        server_name chat.mydomain.tld;
        listen 80 ;
        access_log /var/log/nginx/access.log vhost;
        return 301 https://$host$request_uri;
}
server {
        server_name chat.mydomain.tld;
        listen 443 ssl http2 ;
        access_log /var/log/nginx/access.log vhost;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
        ssl_prefer_server_ciphers on;
        ssl_session_timeout 5m;
        ssl_session_cache shared:SSL:50m;
        ssl_session_tickets off;
        ssl_certificate /etc/nginx/certs/chat.mydomain.tld.crt;
        ssl_certificate_key /etc/nginx/certs/chat.mydomain.tld.key;
        ssl_dhparam /etc/nginx/certs/chat.mydomain.tld.dhparam.pem;
        add_header Strict-Transport-Security "max-age=31536000";
        include /etc/nginx/vhost.d/default;
        location / {
                proxy_pass http://chat.mydomain.tld;
        }
}

I think I miss something but I'm working on this issue from the october 7, that makes me crazy !!! 👎


By the way, I deleted all my images (docker rmi $(docker images -a)), and pull them back to see if the issue was not coming from here and I removed all the directory used by my rocketchat to get the cleanest conf ... no change ...

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked docker-compose.txt and compare the generated Nginx configurations and docker ps output for both servers. Check connectivity to the Rocket.Chat container on the reported address and port with telnet, then determine what differs between the Docker networks or container configuration; done means the cause of the refused connection is identified and the two deployments behave consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, docker-compose, nginx
Domain
devops, infrastructure, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.