Remove Shiny Server and use only shiny behind a reverse proxy

49 views
Skip to first unread message

MickPetit

unread,
Aug 13, 2022, 1:54:28 PM8/13/22
to Shiny - Web Framework for R
Hello,

I'm new in Shiny world (less then one year). I've create some apps that works on shiny server with an architecture like that :
user -> Apache Reverse Proyx -> Dockerized Shiny server with app 1
                                                              -> Dockerized Shiny server with app 2
                                                              ->..................
That's work well.

Now I will need to get some cutom HTTP headers in my shiny apps and the community version has remove this functionality. I know it s possible to put back this functionality but it s the opportunity to try my apps Without Shiny server. (and without others, like shinyProxy).

So I have a new docker with a simple shiny::runapp(), I've configure my reverse proxy in the same way than for shiny server, but the Shiny Apps freeze withe the famous "unable to load http://url/websockets.

Does anyone have a good config for running Shiny behind an apache reverse proxy ?

Regards,

Mick

MickPetit

unread,
Aug 13, 2022, 1:58:59 PM8/13/22
to Shiny - Web Framework for R
this is an example of one of my non working apache confs :

<Location "/app/">
      #RedirectMatch permanent ^/app$ /app/

       RewriteEngine on

       RewriteCond %{HTTP:Upgrade} =websocket
       RewriteRule /app/(.*) ws://localhost:49171/$1 [P,L]       
       #RewriteRule /app/websocket/(.*) ws://localhost:49171/$1 [P,L]

       RewriteCond %{HTTP:Upgrade} !=websocket
       RewriteRule /app/(.*) http://localhost:49171/$1 [P,L]
      
       #RewriteRule /app/websocket/(.*) http://localhost:49171/$1 [P,L]

       ProxyPass  http://localhost:49171/
       ProxyPassReverse  http://localhost:49171/

       #Header edit Location ^/ /app/
       #Include /etc/apache2/docker-conf/common/ldap.conf
        
</Location>
Reply all
Reply to author
Forward
0 new messages