Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run shinyapp in https mode

Tags:

r

shiny

I want deploy my app with shiny using command shiny::runApp(). My question is if it's possible to do this use https instead of http (I can't install shiny server).

Now I run in this mode: shiny::runApp("app.R", port=3090, host="myipaddress"). I have a domain that point in the ip address and if I write in browser: http://mydomain:3090 works correctly.

My problem is that I can't find any mode to switch from http://mydomain:3090 to https://mydomain:3090.

Any help is appreciated

like image 540
Luke Avatar asked Sep 19 '25 18:09

Luke


1 Answers

As suggest Sergio Romero I have used reverse proxy on apache on port 443 and handle ssl certificate. I followed this guide to setting configuration of Virtual Host on Apache

<VirtualHost *:443>
  ServerName mydomainname

  <Proxy *>
    Allow from mydomainname
  </Proxy>

  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} =websocket
  RewriteRule /(.*) ws://mydomainname:myport/$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket
  RewriteRule /(.*) http://mydomainname:myport/$1 [P,L]

  ProxyPass / http://mydomainname:myport/
  ProxyPassReverse / http://mydomainname:myport/
  ProxyRequests Off

  ## SSL directives
  SSLEngine on
  SSLCertificateFile      "path_to_cert.pem"
  SSLCertificateKeyFile   "path_to_privkey.pem"
  SSLCertificateChainFile "path_to_fullchain.pem"
</VirtualHost>
like image 68
Luke Avatar answered Sep 22 '25 07:09

Luke