Shiny Websocket Error
I think you forgot these three wonderful lines of code required to use WebSockets with Nginx:
proxy_http_version 1.1;proxy_set_header Upgrade $http_upgrade;proxy_set_header Connection "upgrade";
Add them to your location /rstudio/ {}
Also, by default the connection will be closed after 30 seconds without activity.Workaround:
proxy_read_timeout 999999999;
WebSockets need HTTP 1.1 protocol for working. These 3 lines make the browser connect to the website using HTTP 1.1, and proxy your server as HTTP 1.1.
If you want to know more, here's a blog post that might help.
After struggling on this same issue for some days I found that the problem was that the Firewall was preventing the websocket from working. I had Pandas Antivirus installed and Firewall was enabled in it. When I turned it off and used Windows firewall and opened that incoming port then it started working.
Hope it helps