4

Actually i need to run rstudio server using https.

By default is http://server-ip:8787

I am following this file- (ssl- configuration)

https://s3.amazonaws.com/rstudio-server/rstudio-server-pro-0.98.507-admin-guide.pdf

Ashish Kumar
  • 41
  • 1
  • 3

3 Answers3

4

You can set-up access to the RStudio server via a proxy. By doing that and setting up the Apache or Nginx web server to use SSL, you will have secure access to the RStudio server.

sebschub
  • 213
  • 4
  • 20
3

Here's an example of how you can both Shiny and RStudio running on the same domain using SSL and Nginx. If you use https://YOURDOMAIN/ it will run your shiny apps; https://YOURDOMAIN/rstudio to be able to edit the shiny apps directly from the browser!

Replace YOURDOMAIN with your server URL:

map $http_upgrade $connection_upgrade {
 default upgrade;
 ''     close;
}

#Server with proxy
server {
 listen 443 ssl default_server;
 listen [::]:443 ssl default_server;
 ssl_certificate /etc/letsencrypt/live/YOURDOMAIN/cert.pem;
 ssl_certificate_key /etc/letsencrypt/live/YOURDOMAIN/privkey.pem;

 server_name YOURDOMAIN;

 location / {
     proxy_pass http://localhost:3838;
     proxy_redirect http://localhost:3838/ $scheme://$host/;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection $connection_upgrade;
     proxy_read_timeout 20d;
 }

 location /rstudio/ {
     rewrite ^/rstudio/(.*)$ /$1 break;
     proxy_pass http://localhost:8787;
     proxy_redirect http://localhost:8787/ $scheme://$host/rstudio/;
     proxy_http_version 1.1;
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection $connection_upgrade;
     proxy_read_timeout 20d;
 }
}
Federico Grandi
  • 6,785
  • 5
  • 30
  • 50
1

Unfortunately SSL is only available in the paid version. See: https://www.rstudio.com/products/rstudio-server-pro/

  • 1
    This is not accurate. SSL is *easy* to get in the paid version, but it is certainly possible to set up SSL for the free version – arokem Nov 01 '18 at 12:50
  • @arokem Perhaps you could provide a solution then that works with the free version of rserver? – James Hirschorn Dec 08 '21 at 19:10
  • I believe my answer from a few years ago might still work: https://stackoverflow.com/a/53102586/3532933 – arokem Dec 09 '21 at 21:11