Hello!
I’ve installed Rocket.Chat via Ubuntu Snap on a Vultr VPS running Ubuntu 16.04.
I’ve configured nginx according to the Rocket.Chat Documentation pages, and have the following setup:
NGINX
Upstreams
upstream backend {
server 127.0.0.1:3000;
}
server {
listen 443 ssl;
server_name chat.url;
error_log /var/log/nginx/rocketchat_error.log;
ssl_certificate /etc/letsencrypt/live/chat.url/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chat.url/privkey.pem; # managed by Certbot
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
location / {
proxy_pass http://backend/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $http_host;
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 /api {
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 104.16.0.0/12;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 131.0.72.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 162.158.0.0/15;
set_real_ip_from 172.64.0.0/13;
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
set_real_ip_from 2400:cb00::/32;
set_real_ip_from 2606:4700::/32;
set_real_ip_from 2803:f800::/32;
set_real_ip_from 2405:b500::/32;
set_real_ip_from 2405:8100::/32;
set_real_ip_from 2c0f:f248::/32;
set_real_ip_from 2a06:98c0::/29;
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
real_ip_header X-Forwarded-For;
client_max_body_size 100M;
}
}
server {
if ($host = chat.url) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name chat.url;
return 404; # managed by Certbot
}
I am able to access the RC server by visiting chat.url in any browser and it will load (mostly) correctly, but when attempting to visit using the desktop or mobile apps, nothing will load unless I put the server’s external IP address and port as the destination.
In addition to NGINX, I have UFW set up as well, with ports 22, NGINX Full, and 3000/TCP allowed, and have tried various version of that setup as well, opening the firewall completely, or completely turning it off. Nothing seemed to change the outcome.
Lastly, I have everything for this server’s routing being passed through CloudFlare, with this particular subdomain already routed through an A record to the server’s static external address. I assumed this is where my issue would lie, but, I’ve played with just about every toggle I could think of on there, and didn’t see any change whatsoever.
More maybe pertinent info:
{“version”:“0.62.2”,“success”:true} (Had to be gotten through the IP Address:port in a browser)
Log Details
e[34mI20180331-22:29:48.551(0) e[32m➔ e[32m±---------------------------------------------------+
e[34mI20180331-22:29:48.552(0) e[32m➔ e[32m| SERVER RUNNING |
e[34mI20180331-22:29:48.558(0) e[32m➔ e[32m±---------------------------------------------------+
e[34mI20180331-22:29:48.559(0) e[32m➔ e[32m| |
e[34mI20180331-22:29:48.560(0) e[32m➔ e[32m| Rocket.Chat Version: 0.62.2 |
e[34mI20180331-22:29:48.561(0) e[32m➔ e[32m| NodeJS Version: 8.8.1 - x64 |
e[34mI20180331-22:29:48.562(0) e[32m➔ e[32m| Platform: linux |
e[34mI20180331-22:29:48.570(0) e[32m➔ e[32m| Process Port: 3000 |
e[34mI20180331-22:29:48.571(0) e[32m➔ e[32m| Site URL: https://chat.url |
e[34mI20180331-22:29:48.574(0) e[32m➔ e[32m| ReplicaSet OpLog: Enabled |
e[34mI20180331-22:29:48.575(0) e[32m➔ e[32m| Commit Hash: 07f0e3f77c |
e[34mI20180331-22:29:48.578(0) e[32m➔ e[32m| Commit Branch: HEAD |
e[34mI20180331-22:29:48.579(0) e[32m➔ e[32m| |
e[34mI20180331-22:29:48.582(0) e[32m➔ e[32m±---------------------------------------------------+
Please feel free to ask for any other information I can provide to help with getting this last bit of initial setup done, and thank you very much for looking!
-Omni