Skip to content
This repository has been archived by the owner on Jun 7, 2020. It is now read-only.

Unable to connect to self hosted Rocket.Chat instance #2798

Open
jackbritchford opened this issue Dec 6, 2019 · 1 comment
Open

Unable to connect to self hosted Rocket.Chat instance #2798

jackbritchford opened this issue Dec 6, 2019 · 1 comment

Comments

@jackbritchford
Copy link

jackbritchford commented Dec 6, 2019

  • 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?

@jackbritchford
Copy link
Author

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;
    }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant