我被我的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