I set up the R shiny server with a apache proxy. The server will accept request from port 80 and forward it to port 3838
In my virtue host file I have the following:
ProxyPass /shinyport/ http://localhost:3838/
ProxyPassReverse /shinyport/ http://localhost:3838/
RedirectMatch permanent ^/shinyport$ /shinyport/and I have set up the R shiny configuration file accordingly, too
server {
listen 3838 127.0.0.1;
.......
}
However, when I run the R shiny app (in the directory of testapp under site_dir ) from firefox, the interface can be shown then it stop short with error message in java log:
Firefox can't establish a connection to the server at ws://[myservername]/shinyport/testapp/__sockjs__/883/iy9jjfoj/websocket.
I searched on line and found a similar experience
https://github.com/rstudio/ggvis/issues/219which I followed and added the following in my virtue host configuration file
<LocationMatch ^/testapp/_sockjs_/([0-9]+)/([a-z0-9]+)/websocket$>
ProxyPassMatch ws://localhost:3838/testapp/_sockjs_/$1/$2/websocket
</LocationMatch>
However, I still could not have it run and it popped up with the same (but slightly different) error message:
Firefox can't establish a connection to the server at ws://[myservername]/shinyport/testapp/__sockjs__/207/u3wk3o4d/websocket.
Can anyone give a suggestion where I did wrong? I tested the regular expression extensively and the syntax appears to be right. Why is that the proxy request from the websocket kept being blocked even I specified the LocationMatch?
Thanks
P.S. I am using the newest version of R shiny server, Rstudio server, apache and R (as well as ggplot2)