Installed Rocket.chat in Docker, but cannot access 502 Bad Gateway

Description

I know that I’m really close! Any help greatly appreciated.

Server Setup Information

  • Operating System: Debian 9
  • Deployment Method: Docker Compose file linked here
  • Number of Running Instances: 1

docker logs rocketchat_1
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
LocalStore: store created at
Setting default file store to GridFS
Warning: connect.session() MemoryStore is not
designed for a production environment, as it will leak
memory, and will not scale past a single process.
{“line”:“120”,“file”:“migrations.js”,“message”:“Migrations: Not migrating, already at version 147”,“time”:{"$date":1563642898530},“level”:“info”}
ufs: temp directory created at “/tmp/ufs”
Loaded the Apps Framework and loaded a total of 0 Apps!
Updating process.env.MAIL_URL
Using GridFS for custom sounds storage
Using GridFS for custom emoji storage
➔ System ➔ startup
➔ ±---------------------------------------------+
➔ | SERVER RUNNING |
➔ ±---------------------------------------------+
➔ | |
➔ | Rocket.Chat Version: 1.2.1 |
➔ | NodeJS Version: 8.11.4 - x64 |
➔ | MongoDB Version: 4.0.10 |
➔ | MongoDB Engine: mmapv1 |
➔ | Platform: linux |
➔ | Process Port: 4000 |
➔ | Site URL: http://localhost:4000 |
➔ | ReplicaSet OpLog: Enabled |
➔ | Commit Hash: 7475d7628a |
➔ | Commit Branch: HEAD |
➔ | |
➔ ±---------------------------------------------+

Any additional Information

Output from docker-compose.yml
services:
rocketchat:
image: rocketchat/rocket.chat:latest
command: >
bash -c
“for i in seq 1 30; do
node main.js &&
s=$$? && break || s=$$?;
echo “Tried $$i times. Waiting 5 secs…”;
sleep 5;
done; (exit $$s)”
restart: unless-stopped
volumes:
- ./uploads:/app/uploads
environment:
- PORT=4000
- ROOT_URL=http://chat.noisebridge.info:4000
- MONGO_URL=mongodb://noisebridge_mongo_1:27017/rocketchat
- MONGO_OPLOG_URL=mongodb://noisebridge_mongo_1:27017/local
- MAIL_URL=smtp://smtp.email
# - HTTP_PROXY=http://proxy.domain.com
# - HTTPS_PROXY=http://proxy.domain.com
depends_on:
- mongo
ports:
- 4000:3000
labels:
- “traefik.backend=rocketchat”
- “traefik.frontend.rule=Host: your.domain.tld”

mongo:
image: mongo:4.0
restart: unless-stopped
volumes:
- ./data/db:/data/db
#- ./data/dump:/dump
command: mongod --smallfiles --oplogSize 128 --replSet rs0 --storageEngine=mmapv1

Setup from Nginx to subdomain
server {
listen 80;
server_name chat.noisebridge.info;
return 302 https://chat.noisebridge.info$request_uri;
}

server {
server_name chat.noisebridge.info;
ignore_invalid_headers off;
client_max_body_size 0;
proxy_buffering off;

location / {
proxy_pass http://localhost:4000;

proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;

proxy_redirect off;

}

location /.well-known/ {
alias /usr/share/nginx/html/.well-known/;
}

#listen [::]:443 ssl ipv6only=on; # managed by Certbot
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/noisebridge.info/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/noisebridge.info/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
2 Likes

Rocket.Chat Version: 0.57.0 [known due to manual installation] Running Instances: ?? DB Replicaset OpLog: ?? Node Version: v4.2.6 [extracted from terminal by: node -v] ?? - information unavailable due to the following issue: After rebooting the server even with rocket.chat as service I keep receiving bad gateway on the nginx machine. Port via proxy has been set and works when manully running node main.js but in the forever setting (digital ocean explanation) I cannot connect to the platform. Kodi nox

Hi.

Were you able to solve this?

I have setup some rocketchat servers 2 years ago and it worked just fine. Now, I am trying the same procedure and I can’t get past the Bad Gatewat screen. Any info if you managed to overcome it would be welcomed.

Thanks!