Meteor DDP SSL/Apache代理连接

Meteor DDP SSL/Apache代理连接,apache,ssl,meteor,proxy,ddp,Apache,Ssl,Meteor,Proxy,Ddp,我有一台Debian主机,它在NodeJS上运行我的Meteor应用程序,监听:127.0.0.1:3999 我还有一个Apache欢迎的域注册器,它可以代理我的Meteor应用程序 我的DDP连接有问题。 我的连接链接是ws://example.com/websocket 我将ProxyPass设置设置如下: <VirtualHost *:443> ServerName example.com ServerAlias www.example.com

我有一台Debian主机,它在NodeJS上运行我的Meteor应用程序,监听:127.0.0.1:3999 我还有一个Apache欢迎的域注册器,它可以代理我的Meteor应用程序

我的DDP连接有问题。 我的连接链接是
ws://example.com/websocket

我将ProxyPass设置设置如下:

 <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>

ServerName example.com
ServerAlias www.example.com
斯伦金安
SSLProxyEngine打开
代理请求关闭
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/
浏览器匹配“MSIE[2-6]”\
nokeepalive ssl不干净关闭\
降级-1.0力响应-1.0
#MSIE 7和更新版本应该能够使用keepalive
BrowserMatch“MSIE[17-9]”ssl不干净关闭


ServerName example.com
ServerAlias www.example.com
代理请求关闭
重新启动发动机
重写cond%{SERVER\u PORT}^443$
#这允许DDP客户端(如ObjectiveDDP和Meteor Unity)进行连接
重写规则^/websocket wss://%{HTTP_HOST}/websocket[NC,R,L]
#这允许meteor webapp进行连接
重写规则^/sockjs/(.*)/websocket wss://%{HTTP_HOST}/sockjs/$1/websocket[NC,R,L]
重写规则^/(*)https://%{HTTP_HOST}/$1[NC,R,L]

我找到的解决方案不是使用debian,而是使用ubuntu,这样Apache2.6就可以使用了。mod_proxy_wstunnel解决了v2.6的问题

 <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>