Rocket.Chat.iOS
Rocket.Chat.iOS copied to clipboard
Unable to connect to self hosted Rocket.Chat instance
- Your Rocket.Chat app version: latest from iOS app store
- Your Rocket.Chat server version: 2.1.1
- Device (or Simulator) you're running with: iOS
Hi, Whenever I try to connect I get "Oops! - Could not connect to this server!". I have a valid cert (https://msgz.xyz/) and I have nginx setup as a reverse proxy. I'm entering 'msgz.xyz' but i've also tried with http and https prefix.
:~$ curl -i -N -H "Connection: Upgrade" -H "Upgrade: websocket" -H "Host: msgz.xyz" -H "Origin: msgz.xyz" -H "Sec-WebSocket-Key: blahblah" -H "Sec-WebSocket-Version: 13" https://msgz.xyz/websocket
HTTP/2 400
server: nginx/1.14.0 (Ubuntu)
date: Fri, 06 Dec 2019 12:38:43 GMT
Not a valid websocket request
Websockets seem to work, any ideas?
Disabled http2 on nginx reverse proxy and it seems to have fixed the issue. Here is the config I'm using for anyone else:
# Upstreams
upstream backend {
server 127.0.0.1:3000;
}
# HTTPS Server
server {
listen 443;
server_name msgz.xyz;
# You can increase the limit if your need to.
client_max_body_size 200M;
error_log /var/log/nginx/rocketchat.access.log;
ssl on;
ssl_certificate /etc/letsencrypt/live/msgz.xyz/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/msgz.xyz/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # don’t use SSLv3 ref: POODLE
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-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_redirect off;
}
}