I am trying to set up an Apache2 proxy server on a host that serves Tomcat webapps, a Shiny server, and RStudio server. Apache is set up to redirect http to https, and all of my proxy settings are in the default-ssl.conf file, shown below.
Proxies to Tomcat (using ajp_13) work fine.
Proxy to Shiny server mostly works correctly, as long as the address is typed into the address bar. The same address, if clicked or pasted, drops the "shiny" portion. (e.g. https:// my.host.com/shiny/users/me/hello becomes https:// my.host.com/users/me if I click or paste,but works if I type it out.)
Proxying to rstudio-server - well, if I type in the host address followed by /rstudio, it immediately redirects to the host address followed by auth-sign-in (rather than /rstudio/auth-sign-in). If I type in the full path to auth-sign-in, I can sign in, but then it redirects to the base server address rather than /rstudio. If I then type in the base address followed by /rstudio, I get rstudio, and it works fine from then on.
Here is my config: (note - spaces in the addresses are because I'm a new user and it won't let me have more than two "links" in my post.)
<VirtualHost _default_:443>
...
<Proxy *>
Allow from localhost
</Proxy>
ProxyPreserveHost On
RewriteEngine on
RedirectMatch permanent ^/rstudio$ /rstudio/
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/
Header edit Location ^/ /rstudio/
RedirectMatch permanent ^/shiny$ /shiny/
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /shiny/(.*) ws:// localhost:3838/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /shiny/(.*) http:// localhost:3838/$1 [P,L]
ProxyPass /shiny/ http:// localhost:3838/
ProxyPassReverse /shiny/ http:// localhost:3838/
ProxyRequests Off
...
</VirtualHost>
I know I can solve this with virtual servers, but if possible I'd really like it to work without. If anyone can steer me in the right direction, I'd really appreciate it.