问题描述
我有一个Debian主机,它在NodeJS上运行我的Meteor应用程序,它监听:127.0.0.1:3999
我也有一个域名注册受Apache欢迎,并代理到我的Meteor应用程序。
I have Debian host that runs my Meteor application on NodeJS that listens: 127.0.0.1:3999I also have a domain register https://example.com that welcomed with Apache and proxied to my Meteor application.
我在DDP连接方面遇到问题。
我的连接链接是 ws://example.com/websocket
I have problem with DDP Connection.my connection link is ws://example.com/websocket
我设置了ProxyPass设置如下所示:
I set the ProxyPass settings as following:
<VirtualHost *:443>
ServerName example.com
ServerAlias www.example.com
SSLEngine on
SSLProxyEngine On
ProxyRequests Off
SSLCertificateFile /etc/apache2/ssl/www.example.crt
SSLCertificateKeyFile /etc/apache2/ssl/www.example.key
SSLCertificateChainFile /etc/apache2/ssl/sub.class1.server.ca.pem
ProxyPass /websocket ws://localhost:3999/websocket
ProxyPassReverse /websocket ws://localhost:3999/websocket
ProxyPassMatch ^/sockjs/(.*)/websocket ws://localhost:3999/sockjs/$1/websocket
ProxyPass / http://localhost:3999/
ProxyPassReverse / http://localhost:3999/
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
# MSIE 7 and newer should be able to use keepalive
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>
和
And
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ProxyRequests off
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
# This allows DDP clients like ObjectiveDDP and Meteor-Unity to connect
RewriteRule ^/websocket wss://%{HTTP_HOST}/websocket [NC,R,L]
# This allows the meteor webapp to connect
RewriteRule ^/sockjs/(.*)/websocket wss://%{HTTP_HOST}/sockjs/$1/websocket [NC,R,L]
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
</VirtualHost>
推荐答案
我发现的解决方案不是使用debian,而是使用ubuntu,因此Apache 2.6将可用。 mod_proxy_wstunnel解决了v2.6的问题。
The solution I found is not to use debian, instead use ubuntu, so Apache 2.6 would be available. mod_proxy_wstunnel has solved the problem with v2.6.
这篇关于流星DDP SSL / Apache代理连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!