hm I think i got it working. i used snap to install rocket.chat on ubuntu 16.04, then I used the following from the docs:
#manual extension docker with socket upgrade begin
location ~ ^/.* {
proxy_pass http://0.0.0.0:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forward-Proto http;
proxy_set_header X-Nginx-Proxy true;
proxy_http_version 1.1;
proxy_redirect off;
}
it also seems to be secured using letsencrypt so yea, thanks for the help 