Skip to content
GitLab Next
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • omnibus-gitlab omnibus-gitlab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 992
    • Issues 992
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 58
    • Merge requests 58
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • omnibus-gitlabomnibus-gitlab
  • Issues
  • #740
Closed
Open
Created Aug 24, 2015 by MK@kohenkatz

Nginx config missing websocket upgrade for Mattermost

After turning on Gitlab Mattermost, I tried to use it and got lots of HTTP 400 errors trying to open the websocket.

I found dozens of the following error in the Mattermost log file:

2015-08-24_19:15:51.46987 2015/08/24 19:15:51 http: multiple response.WriteHeader calls
2015-08-24_19:15:51.46990 [08/24/15 19:15:51] [EROR] websocket connect err: websocket: could not find connection header with token 'upgrade'
2015-08-24_19:15:51.46991 [08/24/15 19:15:51] [EROR] /api/v1/websocket:connect code=500 rid=MY_RID uid=MY_UID ip=MY_IP Failed to upgrade websocket connection [details: ]

When I added the following into the /var/opt/gitlab/nginx/conf/gitlab-mattermost-http.conf file, the websocket started to work:

  • At the top of the file:

     map $http_upgrade $connection_upgrade {
         default upgrade;
         '' close;
     }
  • Inside the location / block:

     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection $connection_upgrade;

These lines (or similar) should be added to the nginx config file template.

Assignee
Assign to
Time tracking