【问题标题】:Meteor DDP SSL/Apache Proxy ConnectionMeteor DDP SSL/Apache 代理连接
【发布时间】:2015-11-02 03:09:12
【问题描述】:

我有 Debian 主机,它在 NodeJS 上运行我的 Meteor 应用程序,它监听:127.0.0.1:3999 我还有一个域名注册 https://example.com,它受到 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>

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

【问题讨论】:

    标签: apache ssl meteor proxy ddp


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-08-02
      • 1970-01-01
      • 1970-01-01
      • 2016-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-09
      相关资源
      最近更新 更多