Chat not refreshing


my chat is not refreshing any more. I noticed this behaviour for some time now - in the past I could work around by reinstalling the server.
Usually it came to this error after updating - and this time it’s worse than ever and even after reinstalling I have this problems.
After sending a message it stays grey:

You have to reload the page in order to see messages.

Server Setup Information

  • Version of Rocket.Chat Server: 3.15.0
  • Operating System: Ubuntu 18.04.5 LTS
  • Deployment Method: tar
  • Number of Running Instances: 1
  • DB Replicaset Oplog: 4.0.24 / mmapv1 (oplog Aktiviert)
  • NodeJS Version: v12.18.4
  • MongoDB Version: 4.0.24
  • Proxy: apache, cloudflare
  • Firewalls involved:

Any additional Information

Firefox Console shows several errors:
Uncaught (in promise) undefined
Firefox can’t establish connection to the server wss://

My apache Proxy config:

Require all granted

RewriteEngine On
RewriteCond %{HTTP:CONNECTION} Upgrade [NC]
RewriteCond %{HTTP:Upgrade} =websocket [NC]
RewriteRule /(.*)           ws://localhost:3000/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket [NC]
RewriteRule /(.*)           http://localhost:3000/$1 [P,L]

ProxyPassReverse /          http://localhost:3000/

I can partitially solve this problem already:
I had cloudflare cache active and this seemed to be the main problem. now only a few users have problems like this (after clearing cache etc).

but the can’t establish connection to the server wss://bla error remained.
anyone an idea about that?

I suggest you spend some time on your apache config which is most likely the issue (possibly with CDN thrown in to complicate things).

First disable CDN and get your websockets right. That is the normal issue with ‘connecting’ and greyed out messages.

See how to test here - look for websockets at the end of it:

Also check your SSL certs.

Once you have got that right with no errors then look at CDN.

Hi John,
thanks for pointing me into the right direction!
I checked my bash history and uncovered that I ran proxy_wstunnel without sudo - so it wasn’t activated.
Together with deactivated caching on CDN side everything seems to be fine now!

Yayyyy !!!

Thanks for the feedback and pleased you are up and running OK.