I tried to follow the instructions for serving RStudio from a custom path (e.g. example.com/rstudio), but they didn't work for me.
The instructions: https://support.rstudio.com/hc/en-us/articles/200552326-Configuring-the-Server/
Apache configuration:
RewriteEngine on
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /rstudio/(.*) ws://localhost:8787/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /rstudio/(.*) http://localhost:8787/$1 [P,L]
ProxyPass /rstudio/ http://localhost:8787/
ProxyPassReverse /rstudio/ http://localhost:8787/
ProxyRequests Off
When I visit example.com/rstudio I get redirected to example.com/auth-sign-in and see:
Not Found
The requested URL /auth-sign-in was not found on this server.
If I add two more lines for the auth-sign-in URL like this:
ProxyPass /auth-sign-in http://localhost:8787/auth-sign-in
ProxyPassReverse /auth-sign-in http://localhost:8787/auth-sign-in
Then I see a login screen like this (notice the image does not load):

The image does not load because it's being requested from example.com/images/rstudio.png
Finally, when I try to login with an existing user/pass on my system, I get Error: Not Found.
I guess the instructions should be updated. My guess is that serving from a custom path like example.com/rstudio is more difficult to set up than serving from a naked domain like example.com.
I'd appreciate any tips!