# Please check connection, Mattermost unreachable. If issue persists(...) check WebSocket port

**URL:** <https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903>\
**Category:** Troubleshooting\
**Created:** [May 13, 2023, 3:15am UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903 "2023-05-13T03:15:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![maximilien](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/maximilien/32/6790_2.png) [@maximilien](https://forum.mattermost.com/u/maximilien)\
**Post date:** [May 13, 2023, 3:15am UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/1 "2023-05-13T03:15:38Z")

</div>

Hello there ! First message, hopefully not bothering you.

**Summary**  
Fresh install on last Ubuntu 22.04.2, EC2 instance on AWS.  
Everything works like a charm, but I do have this message on top “Please check connection, Mattermost unreachable. If issue persists, ask administrator to check WebSocket port.”

**Steps to reproduce**  
Deploy last mattermost version on last ubuntu version, instance EC2 on AWS, nginx server.

**Expected behavior**  
Websocket connection should work.

**Observed behavior**  
Everything works, except this message.

**Mattermost conf file**  
(at least the beginning)

```auto
sudo head -n 50 /opt/mattermost/config/config.json 
{
    "ServiceSettings": {
        "SiteURL": "https://mattermost.myawesomewebsite.fr",
        "WebsocketURL": "wss://mattermost.myawesomewebsite.fr/api/v4/websocket",
        "LicenseFileLocation": "",
        "ListenAddress": ":8065",
        "ConnectionSecurity": "",
        "TLSCertFile": "/etc/letsencrypt/live/mattermost.myawesomewebsite.fr/fullchain.pem",
        "TLSKeyFile": "/etc/letsencrypt/live/mattermost.myawesomewebsite.fr/privkey.pem",
        "TLSMinVer": "1.2",
        "TLSStrictTransport": false,
        "TLSStrictTransportMaxAge": 63072000,
        "TLSOverwriteCiphers": [],
        "UseLetsEncrypt": false,
        "LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
        "Forward80To443": false,
        "TrustedProxyIPHeader": [],
        "ReadTimeout": 300,
        "WriteTimeout": 300,
        "IdleTimeout": 60,
        "MaximumLoginAttempts": 10,
        "GoroutineHealthThreshold": -1,
        "EnableOAuthServiceProvider": true,
        "EnableIncomingWebhooks": true,
        "EnableOutgoingWebhooks": true,
        "EnableCommands": true,
        "EnablePostUsernameOverride": false,
        "EnablePostIconOverride": false,
        "GoogleDeveloperKey": "",
        "EnableLinkPreviews": true,
        "EnablePermalinkPreviews": true,
        "RestrictLinkPreviews": "",
        "EnableTesting": false,
        "EnableDeveloper": false,
        "DeveloperFlags": "",
        "EnableClientPerformanceDebugging": false,
        "EnableOpenTracing": false,
        "EnableSecurityFixAlert": true,
        "EnableInsecureOutgoingConnections": false,
        "AllowedUntrustedInternalConnections": "",
        "EnableMultifactorAuthentication": false,
        "EnforceMultifactorAuthentication": false,
        "EnableUserAccessTokens": false,
        "AllowCorsFrom": "",
        "CorsExposedHeaders": "",
        "CorsAllowCredentials": false,
        "CorsDebug": false,
        "AllowCookiesForSubdomains": false,
        "ExtendSessionLengthWithActivity": true,
        "SessionLengthWebInDays": 30,

```

_My nginx conf file_

```auto
server {
    listen 80;
    server_name mattermost.myawesomewebsite.fr;
    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root /var/www/html;
    }
    location / {
        return 301 https://$host$request_uri;
    }
}

server {
    listen 443 ssl http2;
    server_name mattermost.myawesomewebsite.fr;

    ssl_certificate /etc/letsencrypt/live/mattermost.myawesomewebsite.fr/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/mattermost.myawesomewebsite.fr/privkey.pem;
    ssl_session_timeout 1d;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location / {
        gzip off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_pass http://localhost:8065;
        proxy_redirect off;
        # WebSocket Support
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_read_timeout 86400;
    }
}

```

---

<div class="post-metadata">

**Author:** ![maximilien](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/maximilien/32/6790_2.png) [@maximilien](https://forum.mattermost.com/u/maximilien)\
**Post date:** [May 20, 2023, 4:05pm UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/2 "2023-05-20T16:05:16Z")

</div>

Hey there !

Any update please ? Anyone knowing how to solve this ? 🙂 🙏

---

<div class="post-metadata">

**Author:** ![maximilien](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/maximilien/32/6790_2.png) [@maximilien](https://forum.mattermost.com/u/maximilien)\
**Post date:** [June 14, 2023, 2:59pm UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/3 "2023-06-14T14:59:42Z")

</div>

Desperately trying to solve this. Any idea guys ? I’m begging you 😅

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [June 15, 2023, 3:27am UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/4 "2023-06-15T03:27:25Z")

</div>

Hi @maximilien , welcome to the Mattermost forums and sorry for my late reply!

Please check out the official documentation on how to configure nginx as a reverse proxy for Mattermost. Your configuration file is missing the relevant part for the websockets which is also the reason for the message you’re seeing:

[https://docs.mattermost.com/install/config-proxy-nginx.html](https://docs.mattermost.com/install/config-proxy-nginx.html)

---

<div class="post-metadata">

**Author:** ![maximilien](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/maximilien/32/6790_2.png) [@maximilien](https://forum.mattermost.com/u/maximilien)\
**Post date:** [June 15, 2023, 6:55am UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/5 "2023-06-15T06:55:18Z")

</div>

Thanks so much for your answer, agriesser ! 🙂

I’ve just made the relevant corrections and yet, I have the same ugly red message and no improvements…

Here is what the mattermost.conf looks like now. (obviously I’ve anonymised it)

```auto

upstream backend {
   server localhost:8065;
   keepalive 32;
}

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

server {
  listen 80 default_server;
  server_name mattermost.your-domain.com;
  return 301 https://$server_name$request_uri;
}

server {
   listen 443 ssl http2;
   server_name mattermost.your-domain.com;

   http2_push_preload on;

   ssl on;
   ssl_certificate /etc/letsencrypt/live/your-domain/fullchain.pem;
   ssl_certificate_key /etc/letsencrypt/live/your-domain/privkey.pem;
   ssl_session_timeout 1d;

   ssl_protocols TLSv1.2 TLSv1.3;

   ssl_early_data on;

   ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384';
   ssl_prefer_server_ciphers on;
   ssl_session_cache shared:SSL:50m;

   add_header Strict-Transport-Security max-age=15768000;

   ssl_stapling on;
   ssl_stapling_verify on;

   add_header X-Early-Data $tls1_3_early_data;

   location ~ /api/v[0-9]+/(users/)?websocket$ {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       client_max_body_size 50M;
       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-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 90;
       proxy_send_timeout 300;
       proxy_read_timeout 90s;
       proxy_http_version 1.1;
       proxy_pass http://backend;
   }

   location / {
       client_max_body_size 50M;
       proxy_set_header Connection "";
       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-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache mattermost_cache;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://backend;
   }
}

map $ssl_early_data $tls1_3_early_data {
  "~." $ssl_early_data;
  default "";
}

```

Any idea what I’m missing ?

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [June 15, 2023, 7:13am UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/6 "2023-06-15T07:13:54Z")

</div>

You did reload `nginx`, right?  
Please remove the `WebSocketURL` configuration from your config file again, it’s not needed (the default should work just fine).

---

<div class="post-metadata">

**Author:** ![maximilien](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/maximilien/32/6790_2.png) [@maximilien](https://forum.mattermost.com/u/maximilien)\
**Post date:** [June 15, 2023, 2:47pm UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/7 "2023-06-15T14:47:34Z")

</div>

Yes I did reload nginx with no effect.

But removing the WebSocketURL did the trick ! 😍 Thanks so much ! You made my day ! 🙏

---

<div class="post-metadata">

**Author:** ![agriesser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/agriesser/32/5644_2.png) [@agriesser](https://forum.mattermost.com/u/agriesser)\
**Post date:** [June 16, 2023, 4:03am UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/8 "2023-06-16T04:03:05Z")

</div>

Awesome, thanks for letting us know that this fixed it 🙂 I guess you tried to play around with the settings when you first noticed the error message and did not revert it since then.

---

<div class="post-metadata">

**Author:** ![Herman](https://avatars.discourse-cdn.com/v4/letter/h/eada6e/32.png) [@Herman](https://forum.mattermost.com/u/Herman)\
**Post date:** [April 16, 2024, 9:47pm UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/9 "2024-04-16T21:47:55Z")

</div>

Hi.

Almost a year later, and this problem still persists! I have a clean installation on Ubuntu, and connecting directly to it’s 8065 port. No web server to proxy. STILL have this issue!

Any resolve?

Thanks

---

<div class="post-metadata">

**Author:** ![john.oliver](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.oliver/32/6436_2.png) [@john.oliver](https://forum.mattermost.com/u/john.oliver)\
**Post date:** [April 17, 2024, 5:04pm UTC](https://forum.mattermost.com/t/please-check-connection-mattermost-unreachable-if-issue-persists-check-websocket-port/15903/10 "2024-04-17T17:04:43Z")

</div>

@Herman where are you connecting from? WebSocket is a different protocol than HTTP. You need to look at everything between your client and Mattermost server… any firewall, load balancer, security groups, everything. Something is allowing HTTP on 8065 but not WebSocket.
