我被我的Apache-config卡住了,并且非常感谢这方面的帮助。如何通过Apache代理WebSocket来播放框架
的配置是这样的:
- Apache的重定向所有HTTP流量HTTPS
- 它代理像https://domain.tld/app1到http://domain.tld:9000/app1(Play中的应用,在应用程序上下文中运行的请求/应用程序*/... )
这工作得很好,下面的Apache的配置:
<VirtualHost *:80>
ServerName domain.tld
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Redirect permanent/https://domain.tld/
Redirect permanent/https://domain.tld/
</VirtualHost>
<VirtualHost _default_:443>
#ssl-config here
<Proxy http://localhost:9000/*>
Order deny,allow
Allow from all
</Proxy>
ProxyPass /app1 http://domain.tld:9000/app1
ProxyPassReverse /app1 http://domain.tld:9000/app1
ProxyPassReverse /app1 http://domain.tld/app1
</VirtualHost>
问题在于,一个游戏应用程序加入了WebSocket。这不符合上述设置。所以我读了play-pages上的东西。这导致我安装了mod_proxy_wstunnel。我还有以下行添加到配置,但与没有成功:
ProxyPass /app1/timerWs ws://domain.tld:9000/app1/timerWs
ProxyPassReverse /app1/timerWs ws://domain.tld:9000/app1/timerWs
当我试图连接到https://domain.tld/rlc/timerWs我得到了一个500内部服务器错误,但目前还没有新的,更具体的错误在Apache错误日志中。
如何配置Apache以正确代理WebSocket请求到我的播放应用程序?
我的play-apps没有https适配器。所有的https都是由Apache代理完成的。
Play-apps在版本2.5上。 Apache在2.4.7上。
非常感谢您的帮助。 Tobias