Jupyter-server-proxy setup for rstudio

Could someone share the setup to start rstudio with the jupyter-server-proxy or help me complete mine.
I have managed to start rstudio, but the first launch fails.

Here is what I have done so far:

  1. rstudio is installed in the docker image (I use jupyterhub with dockerspawner)
  2. jupyter_notebook_config.py
c.ServerProxy.servers = {
  'rstudio': {
    'command': [
      '/usr/lib/rstudio-server/bin/rserver',
      '--config-file=/home/jovyan/.jupyter/rstudio.conf',
      '--www-port={port}'
    ],
    'timeout': 20,
    'launcher_entry': {
      'title': 'RStudio'
    }
  }
}
  1. /home/jovyan/.jupyter/rstudio.conf
auth-none=1
www-address=127.0.0.1
server-working-dir=/home/jovyan
server-user=jovyan
www-root-path=/jhub/user/h501uvma/rstudio/
database-config-file=/home/jovyan/.jupyter/rstudio-db.conf
  1. /home/jovyan/.jupyter/rstudio-db.conf
provider=sqlite
directory=/home/jovyan/.jupyter/

My jupyterhub is in https://myhost.com/jhub behind a reverse proxy
Upon restarting the server the launch icon is setup ok. When I click it opens a new tab with

https://myhost.com%2C%20myhost.com/jhub/user/admin/rstudio/auth-sign-in?appUri=%2F

But it should be

https://myhost.com/jhub/user/admin/rstudio/auth-sign-in?appUri=%2F

If I delete twice the duplicated part of the url “myhost.com%2C%20”, then rstudio starts and from that moment, it works well, except that for each new jupyterlab user of if the rstudio local files are deleted, then the initial start fails again.

There’s a dedicated plugin for rstudio (that wraps jupyter-server-proxy):

Though note this bug with RStudio 1.4 which sounds like the problem you’re seeing: