# Websocket problem

**URL:** <https://forum.mattermost.com/t/websocket-problem/11947>\
**Category:** Docs - Help Wanted\
**Created:** [July 21, 2021, 12:52pm UTC](https://forum.mattermost.com/t/websocket-problem/11947 "2021-07-21T12:52:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![punkgeek](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@punkgeek](https://forum.mattermost.com/u/punkgeek)\
**Post date:** [July 21, 2021, 12:52pm UTC](https://forum.mattermost.com/t/websocket-problem/11947/1 "2021-07-21T12:52:31Z")

</div>

Hello,  
I’ve installed Mattermost on the fresh Ubuntu 20.04 VM. But I have this problem:

```auto
{"level":"error","ts":1626871612.3405845,"caller":"mlog/log.go:251","msg":"Failed to upgrade websocket connection.","path":"/api/v4/websocket","request_id":"esazb6p8u7go3j37pu4rxgy9yc","ip_addr":"127.0.0.1","user_id":"5p4gp6bi7inwbdm6gnagz4kdmr","method":"GET","err_where":"connect","http_code":500,"err_details":"websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"}

```

Here is my config details:

```auto
{
    "ServiceSettings": {
        "SiteURL": "https://chat.#mydomain.net",
        "WebsocketURL": "",
        "LicenseFileLocation": "",
        "ListenAddress": ":8065",
        "ConnectionSecurity": "TLS",
        "TLSCertFile": "/etc/nginx/ssl/mattermost.cert",
        "TLSKeyFile": "/etc/nginx/ssl/mattermost.key",
        "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": false,
        "EnableIncomingWebhooks": true,
        "EnableOutgoingWebhooks": true,
        "EnableCommands": true,
        "EnablePostUsernameOverride": false,
        "EnablePostIconOverride": false,
        "GoogleDeveloperKey": "",
        "EnableOnlyAdminIntegrations": true,
        "EnableLinkPreviews": true,
        "RestrictLinkPreviews": "",
        "EnableTesting": false,
        "EnableDeveloper": 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,
        "SessionLengthMobileInDays": 30,
        "SessionLengthSSOInDays": 30,
        "SessionCacheInMinutes": 10,
        "SessionIdleTimeoutInMinutes": 43200,
        "WebsocketSecurePort": 443,
        "WebsocketPort": 80,
        "WebserverMode": "gzip",
        "EnableGifPicker": true,
        "GfycatApiKey": "2_KtH_W5",
        "GfycatApiSecret": "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof",
        "EnableCustomEmoji": true,
        "EnableEmojiPicker": true,
        "RestrictCustomEmojiCreation": "all",
        "RestrictPostDelete": "all",
        "AllowEditPost": "always",
        "PostEditTimeLimit": -1,
        "TimeBetweenUserTypingUpdatesMilliseconds": 5000,
        "EnablePostSearch": true,
        "EnableFileSearch": true,
        "MinimumHashtagLength": 3,
        "EnableUserTypingMessages": true,
        "EnableChannelViewedMessages": true,
        "EnableUserStatuses": true,
        "ExperimentalEnableAuthenticationTransfer": true,
        "ClusterLogTimeoutMilliseconds": 2000,
        "CloseUnusedDirectMessages": false,
        "EnablePreviewFeatures": true,
        "EnableTutorial": true,
        "ExperimentalEnableDefaultChannelLeaveJoinMessages": true,
        "ExperimentalGroupUnreadChannels": "disabled",
        "ExperimentalChannelOrganization": false,
        "ImageProxyType": "",
        "ImageProxyURL": "",
        "ImageProxyOptions": "",
        "EnableAPITeamDeletion": false,
        "EnableAPIUserDeletion": false,
        "ExperimentalEnableHardenedMode": false,
        "DisableLegacyMFA": true,
        "ExperimentalStrictCSRFEnforcement": false,
        "EnableEmailInvitations": true,
        "DisableBotsWhenOwnerIsDeactivated": true,
        "EnableBotAccountCreation": false,
        "EnableSVGs": false,
        "EnableLatex": false,
        "EnableAPIChannelDeletion": false,
        "EnableLocalMode": false,
        "LocalModeSocketLocation": "/var/tmp/mattermost_local.socket",
        "EnableAWSMetering": false,
        "SplitKey": "",
        "FeatureFlagSyncIntervalSeconds": 30,
        "DebugSplit": false,
        "ThreadAutoFollow": true,
        "CollapsedThreads": "disabled",
        "ManagedResourcePaths": "",
        "EnableLegacySidebar": false,
        "EnableReliableWebSockets": false
    },

```

And my Nginx config:

```auto
server {
    listen 80;
    listen 443 ssl;

    server_name chat.#mydomain.net;

    location / {
        proxy_redirect off;
        proxy_set_header Host $host;
        proxy_pass http://127.0.0.1:8065;
    }

    ssl_certificate /etc/nginx/ssl/mattermost.cert;
    ssl_certificate_key /etc/nginx/ssl/mattermost.key;
}

```

---

<div class="post-metadata">

**Author:** ![ahmaddanial](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/ahmaddanial/32/2938_2.png) [@ahmaddanial](https://forum.mattermost.com/u/ahmaddanial)\
**Post date:** [July 22, 2021, 1:06am UTC](https://forum.mattermost.com/t/websocket-problem/11947/2 "2021-07-22T01:06:22Z")

</div>

Hello, @punkgeek

The specific error you shared:

```auto
websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header"

```

was discussed earlier in this topic and Agniva has shared a sample config that works [here](https://forum.mattermost.com/t/websocket-connect-err-error-websocket-the-client-is-not-using-the-websocket-protocol-upgrade-token-not-found-in-connection/9110/5).

Would you mind testing this on your end by adding the `location ~ /api/v[0-9]+/(users/)?websocket$` section and verify if that works?
