Reputation: 13
I am trying to use Apache as a reverse proxy to my Jetty server running cometd.
My setup is working like this:
Apache(HTTPS) --> Jetty(HTTP)
Here is the Apache conf file
<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>
On the client I'm using cometd.js.
However I'm getting this error on the client during handshake
Error during WebSocket handshake: Unexpected response code: 400
The address is wss://y.domain.com
After that the client is trying again and site is up - but I'm afraid the handshake is with long polling...
What am I missing?
Upvotes: 1
Views: 462
Reputation: 21
Ordering of ProxyPass directive matters
The configured ProxyPass and ProxyPassMatch rules are checked in the order of configuration. The first rule that matches wins.
http://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass
Upvotes: 2