Mattermost Real-Time Features Not Working (e.g. Posts Aren't Showing Up) When Connecting From Multiple Origins

Applies to: Mattermost v7.8 and later
Symptoms: Connection errors, posts not updating, missing notifications

 

Problem

Starting with Mattermost v7.8, a stricter origin validation check was introduced for WebSocket connections to improve security. This change can cause connectivity issues when users access Mattermost from different domains/origins than the configured site URL.

Symptoms

Users experiencing this issue will see:

Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.
Screenshot 2025-07-16 at 14.51.32.png


Additionally, the following functionality may be affected:

  • Channels and posts not updating in real-time
  • Notifications not appearing
  • General loss of real-time chat functionality
  • Users may need to refresh the page to see new messages
Note: This issue typically occurs when users access Mattermost through a different domain than the one configured in the site URL, such as through a reverse proxy, load balancer, or when using multiple domain names.

 

Solution

To resolve this issue, you need to configure Mattermost to allow WebSocket connections from additional origins. Follow these steps, either in your config.json or system console:

Verify Site URL Configuration

Ensure that your Site URL is correctly configured in your Mattermost configuration:

"ServiceSettings": {
  "SiteURL": "https://your-mattermost-domain.com"
}
Screenshot 2025-07-16 at 15.52.38.png

The Site URL should match the primary domain users use to access Mattermost.

Configure CORS Settings

Add the AllowCorsFrom setting to allow WebSocket connections from additional origins:

"ServiceSettings": {
  "SiteURL": "https://your-mattermost-domain.com",
  "AllowCorsFrom": "https://alternative-domain.com https://another-domain.com"
}
Screenshot 2025-07-16 at 15.54.13.png

Important: Replace the example domains with the actual domains your users access Mattermost from. Multiple domains should be separated by spaces.

Restart Mattermost

After making configuration changes, restart your Mattermost server for the changes to take effect:

sudo systemctl restart mattermost


Verify the Fix

Ask affected users to:

  • Clear their browser cache and cookies for the Mattermost site
  • Refresh the Mattermost page
  • Check that real-time features are working (posts updating, notifications appearing)
Security Consideration: Only add trusted domains to the AllowCorsFrom setting. Adding untrusted domains could potentially expose your Mattermost instance to security risks.

Additional Resources

For more detailed information about CORS configuration and other integration settings, refer to the official Mattermost documentation:

Mattermost Integrations Configuration Settings - CORS

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Article is closed for comments.