【发布时间】:2015-11-23 10:12:28
【问题描述】:
根据apaches 文档,wstunnel 是在 2.4 中添加的,我应该能够路由流量。
我有以下设置
Apache tomcat 在 8081 和 8444 上运行。
Tomcat 提供静态文件 (html/js) 和 groovy/grails (war) 文件
我已代理 8081 <- 80 和 8444 <- 443
意思是我可以去http://domain/app 看看我必须去http://domain:8081/app 看看。 [这工作得很好]
但是,在静态 javascript/html 页面中,有一个使用 websocket 返回到 tomcat 的连接。我的应用尝试连接回名为 inf 的应用,但失败了。
此代理/连接失败。
我在日志中看到 httpd (apache) 无法找到 /inf/stomp/getInfo 的正确协议,这是后端 websocket 的 url
我已尝试遵循this posts 注释以及this post 中提到的正确顺序
httpd.conf
Listen 443
ServerName mydomain
<VirtualHost *:443>
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /etc/httpd/ssl/ssl.crt
SSLCertificateKeyFile /etc/httpd/ssl/ssl.key
RequestHeader set Front-End-Https "On"
SSLProxyEngine on
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
LogLevel debug
ProxyPass /mainView https://mydomain:8443/mainView
ProxyPassReverse /mainView https://mydomain:8443/mainView
ProxyPass /cas https://mydomain:8443/cas
ProxyPassReverse /cas https://mydomain:8443/cas
# <not working as it should>
ProxyPass /inf/ ws://mydomain:8081/inf/
ProxyPassReverse /inf/ ws://mydomain:8081/inf/
# </not working as it should>
ProxyPass /inf/ wss://mydomain:8444/inf/
ProxyPassReverse /inf/ wss://mydomain:8444/inf/
ProxyPass /inf-app https://mydomain:8444/
ProxyPassReverse /inf-app https://mydomain:8444/
</VirtualHost>
【问题讨论】:
标签: apache tomcat proxy websocket stomp