A note regarding running shiny apps from a DigitalOcean Ubuntu install of RStudio Server

This link provides step by step instructions for setting up RStudio Server and Shiny on a Digital Ocean Ubuntu droplet: Dean Attali’s Blog Entry

It is very important to note that if one follows Step 9: Make pretty URLs for RStudio Server and Shiny Server, that one also follows these additional steps (from Dean Attali’s blog):

Bonus for advanced users: The above setup should be just fine for most users, but I did notice a few small issues with RStudio that seem to be fixed by allowing nginx to proxy WebSockets. For example, I noticed that when using the ggvis package in my RStudio, tooltips were not working. The fix is to add the following three lines inside the location /rstudio/ settings (keep the proxy_pass line and just add these three, and remember you have to restart nginx after changing the settings):

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";

If you’re hosting a Shiny Server, add these 3 lines after the proxy_pass line inside location /shiny/ as well.

If those steps are not taken, then one will not be able to execute shiny apps from RStudio server (i.e., the app will start but the window will “gray” out). Complications may also appear with the R shiny server. However, allowing nginx to proxy Websockets remedies the problems.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s