有人知道我如何将ws连接代理到ws吗?
例如:
ProxyPass"wss://"ws://">
解决方案是使用重写规则:
RewriteEngine On
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://localhost:9001/api/$1 [P,L]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) http://localhost:9001/api/$1 [P,L]