我在使用Apache 24的Tomcat中使用primefaces push时遇到了问题。
以下是显示的错误:
java.lang.UnsupportedOperationException: HTTP upgrade is not supported by the AJP protocol
Belows是网络控制台控制台中的错误
WebSocket connection to 'wss://myhost.com/primepush/customers/org?X-…ransport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true' failed: Error during WebSocket handshake: Unexpected response code: 500
Websocket closed, reason: Connection was closed abnormally (that is, with no close frame being sent). - wasClean: false
Websocket failed on first connection attempt. Downgrading to long-polling and resending
我读到AJP协议不支持升级到其他协议 协议(例如websocket,HTTP / 2)。我可能需要设置我的反向代理,但我对如何正确设置它有点困惑。有人有这方面的经验吗?
注意:如果我不使用Apache而只使用正常的HTTP,这是有效的。
此ws的当前反向代理设置:
LoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.so
ProxyPass /primepush/ ws://localhost:8080/primepush/
ProxyPassReverse /primepush/ ws://localhost:8080/primepush/
我还在tomcat中添加了连接器
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
以上设置发现错误:
AH01144: No protocol handler was valid for the URL /primepush/customers....
make sure the proxy submodules are included in the configuration using LoadModule.
以下是ws模块状态:
proxy_wstunnel_module (shared)
我也发现了一些奇怪的事情:
其他信息:推送工作仍然有效,没有消息说它会降级以进行轮询,但我真的很担心这个错误的根源是什么以及它会产生什么影响。