【发布时间】:2016-10-09 20:23:34
【问题描述】:
我被我的 Apache 配置卡住了,感谢任何帮助。
配置是这样的:
- Apache 将所有 http 流量重定向到 https
- 它将https://domain.tld/app1 之类的请求代理到http://domain.tld:9000/app1(播放应用程序在app-context /app*/...上运行)
这适用于以下 Apache-config:
<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 请求正确地代理到我的游戏应用程序?
我的游戏应用没有 https 适配器。所有 https 的东西都是由 Apache 代理完成的。
Play 应用的版本为 2.5。 Apache 在 2.4.7 上。
非常感谢您的帮助。 托比亚斯
【问题讨论】:
标签: https playframework websocket mod-proxy playframework-2.5