You need to add the Upgrade and Connection headers to proxy the websocket connection correctly.
I have just tested nginx proxy using this config upstream docservice { server my-document-server-address;}map $http_host - Pastebin.com (based on https://github.com/ONLYOFFICE/document-server-proxy/blob/master/nginx/proxy-https-to-http.conf) and there were no websocket errors.