Ashish Kumar
Ashish Kumar

Reputation: 41

Generate ssl-certificate and configure RStudio server?

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

Upvotes: 4

Views: 6876

Answers (3)

Denzil Ferreira
Denzil Ferreira

Reputation: 71

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;
 }
}

Upvotes: 3

sebschub
sebschub

Reputation: 223

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.

Upvotes: 4

user2992013
user2992013

Reputation: 19

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

Upvotes: 1

Related Questions