2014-08-27 74 views
1

我正在嘗試使用Apache作爲運行cometd的Jetty服務器的反向代理。mod_proxy_wstunnel在jetty上運行的cometd

我的設置是這樣工作:

Apache(HTTPS) --> Jetty(HTTP) 

這裏是Apache的conf文件

<VirtualHost *:443> 
     ServerAdmin [email protected] 
     ServerName y.domain.com 

     ProxyPass/http://localhost:8888/ 
     ProxyPassReverse/http://localhost:8888/ 

     ProxyPass /ws/ ws://localhost:8888/ 
     ProxyPass /wss/ wss://localhost:8888/ 

     ProxyRequests Off 
     ProxyVia On 
     Timeout 1500 
     KeepAlive On 
     MaxKeepAliveRequests 100 
     KeepAliveTimeout 15 

     <Proxy *> 
       Order deny,allow 
       Deny from all 
       Allow from all 
     </Proxy> 

     SSLEngine On 
     SSLCertificateFile /etc/apache2/ssl/localhost.crt 
     SSLCertificateKeyFile /etc/apache2/ssl/localhost.key 
     SSLCertificateChainFile /etc/apache2/ssl/ca.crt 

     ErrorLog /var/log/apache2/error.log 
     # Possible values include: debug, info, notice, warn, error, crit, 
     # alert, emerg. 
     LogLevel warn 
     CustomLog /var/log/apache2/access.log combined 
     ServerSignature On 
</VirtualHost> 

在我使用cometd.js客戶端。

但是我握手過程中獲得客戶端上此錯誤

Error during WebSocket handshake: Unexpected response code: 400 

地址是wss://y.domain.com

後,客戶端再次嘗試與本站達 - 但我怕握手與長期投票...

我錯過了什麼? ProxyPass指令的

+1

阿帕奇在碼頭面前的是一個已知的性能和容量瓶頸,你能解釋一下爲什麼你覺得有必要使用設置? – 2014-08-27 11:42:33

+0

好吧,我的應用程序使用4個不同的虛擬主機,它們運行在同一臺服務器上。其中一些使用本地apache,一些使用apache作爲反向代理。由於我希望所有的端口都使用帶有443端口的SSL來運行,Apache/NGINX似乎是最好的選擇。如果我以本地模式(使用端口443)運行Jetty,那麼我必須移動到2臺不同的機器,這是我想要的。 – Stimpy 2014-08-28 20:52:54

回答