WebSockets through Apache and Tomcat: HTTP upgrade is not supported by the AJP protocol WebSockets through Apache and Tomcat: HTTP upgrade is not supported by the AJP protocol apache apache

WebSockets through Apache and Tomcat: HTTP upgrade is not supported by the AJP protocol


Use Apache module mod_proxy_wstunnel:

sudo a2enmod mod_proxy_wstunnel

Then use it to let WebSocket connections through by adding this to apache.conf:

ProxyPass "/ws2/"  "ws://localhost:8180/ws"

And make sure you have enabled an HTTP connector in Tomcat by using <Connector protocol="HTTP/1.1" port="8180" ...> in server.xml.