Apache 阻止 Shiny 的 websocket 协议

Apache blocks websocket protocol for Shiny

我已经使用 Shinyproxy 和 Shiny 部署了一个网络应用程序。

如果我去 http://localhost/mycontextpath/app/01_example everything works perfectly. The ProxyPass and ProxyPassReverse have been set up in Apache and now I can go directly to http://mywebsite.org/mycontextpath/app/01_example 使用我的应用程序。

问题是屏幕自动变灰。我知道这是 Apache 的问题,因为浏览器调试器打印此消息:

Firefox can't establish a connection to the server at ws://mywebsite.org/mycontextpath/wonderful_hypatia/websocket/.

我尝试将这一行添加到我的 Apache 配置中:

ProxyPassMatch "^/(.+)/websocket" "ws://localhost:8146/mycontextpath//websocket" keepalive=On

但是好像不行。

有什么建议吗?谢谢!

如果您必须坚持使用 Apache 作为代理服务器,请阅读此 post Running Shiny Server with a Proxy

或者如果您愿意使用 Nginx,Shinyproxy 网站实际上在其网站的 HTTPS (SSL / TLS) 部分下有详细的 Nginx configuration。这也是我正在使用的配置,它工作得很好。