WebSocket not working on Server behind reverse proxy

Hello, erveryone.

I’ve just finished intalling mattermost on a server running CentOS 7 and I’m having some trouble with websockets.

I have two servers, server A and server B. My main website is hosted on server A while Mattermost is hosted on server B. Both servers are connected to the same public IP.

In order to use Mattermost with a subdomain, I’ve created a website with an NGINX reverse proxy rule that sends the user to my server B’s internal IP. Mattermost works correctly but websockets don’t.

If I connect directly to Mattermost using the server B’s IP websockets works fine.

Any idea of how does the NGINX’s reverse proxy should look like so that I can use Mattermost with my subdomain?


I could solve it! If anyone is having this problem check out this post: How to use Nginx as a Reverse proxy for HTTPS and WSS - Self Signed Certificates and Trusted Certificates
on Step 6 - Configure Support to WebSockets is the key for the NGINX reverse proxy configuration.

Hi and welcome to the Mattermost forums!

This is also mentioned in the official documentation. Please check it out, there might be other Mattermost specific configurations you may need.