I'm not making any progress with my Mattermost installation on my server. I've installed everything without any problems.

After that I've enabled the apache mod proxy_wstunnel and added the following directives in my Plesk domain for additional directives (it like <VirtualHost *:80> or <VirtualHost *:443>):


ErrorLog ${APACHE_LOG_DIR}/mattermost-error.log
CustomLog ${APACHE_LOG_DIR}/mattermost-access.log combined

# Enforce HTTPS:
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


ServerName mattermost.xxx.de
ProxyPreserveHost On

# Set web sockets
ProxyRequests Off
RemoteIPHeader CF-Connecting-IP
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/api/v[0-9]+/(users/)?websocket [NC,OR]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC,OR]
RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
RewriteRule .* ws://{REQUEST_URI} [P,QSA,L]
RewriteRule .*{REQUEST_URI} [P,QSA,L]
RequestHeader set X-Forwarded-Proto "https"

<LocationMatch "^/api/v(?<apiversion>[0-9]+)/(?<apiusers>users/)?websocket">
    Require all granted
    ProxyPass ws://{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
    ProxyPassReverse ws://{env:MATCH_APIVERSION}/%{env:MATCH_APIUSERS}websocket
    ProxyPassReverseCookieDomain mattermost.xxx.de

<Location />
    Require all granted
    ProxyPassReverseCookieDomain mattermost.xxx.de

But when I save this, restart apache and go back to Mattermost, I'm still getting the Websocket error:

enter image description here

In the network tab the response is empty....

  • Try to comment out the LocationMatch. – SYN Jan 30 at 16:13
  • @SYN Still not working without it – Mr. Jo Jan 30 at 21:45
  • Can you add apache and mattermost logs? Who's returning that 200? From your browser developer tools, network tab, you should be able to find the response body returned when querying that /api/v4/websocket URL, maybe you would find something interesting there ... Websocket upgrade should return with a 201 code. – SYN Jan 31 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.