[SOLVED] The famous "Failed to upgrade websocket connection"

I have the same error with Mattermost 3.8.2 on Google Cloud Platform when connecting with either the 2016 or 2017 Mattermost Android apps. Do you have any tips for resolving the issue on another platform?

[2017/05/26 19:56:36 UTC] [EROR] websocket connect err: websocket: could not find connection header with token 'upgrade'
[2017/05/26 19:56:36 UTC] [EROR] /api/v4/websocket:connect code=500 rid=mpb68nbs3tyeupuzf9i9mikttr uid=rduuu9qdibgqi8yr5hbqnyc5sh ip=204.115.121.51 Failed to upgrade websocket connection [details: ]