Thanks for sharing the configuration setup. According to the Nginx docs WebSocket proxying, you’ll need to set the following configuration for reverse proxying WebSocket connections:
location / {
...
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
...
proxy_pass http://dgraph;
}
I tried setting those three things (proxy_http_version and the two proxy_set_header) with your example and it worked.