我正在尝试使用Apache在服务器上运行Bokeh应用程序,但是,它无法维护任何websockets,因为Apache一直在尝试重定向Web套接字连接。我一直在使用Bokeh文档中的教程,只做了一些修改:
<VirtualHost *:8080>
# ... other stuff configuring my python virtual environment
ProxyPreserveHost On
ProxyPass /sentiment_app/ws ws://127.0.0.1:5100/sentiment_app/ws
ProxyPassReverse /sentiment_app/ws http://127.0.0.1:5100/sentiment_app/ws
ProxyPass /sentiment_app http://127.0.0.1:5100/sentiment_app/
ProxyPassReverse /sentiment_app http://127.0.0.1:5100/sentiment_app/
<Directory />
Require all granted
Options -Indexes
</Directory>
# ... directory path configuration for static stuff, left out for brevity
</VirtualHost>
我在js控制台中遇到的错误是:
WebSocket连接到'ws://www.mypage.com:8080 / sentiment_app / ws?bokeh-protocol-version = 1.0&amp; bokeh-session-id = hZGE5YRZWeIh6MhanZVIAyW4ioSOr9HP1geLWlE772Pe'失败:WebSocket握手期间出错:意外的响应代码:302
我一直在玩apache conf文件,已经验证了mod_proxy_wstunnel和所有其他需要运行的东西都已启动并配置,但仍然会收到错误。有什么建议吗?