手动集群后,mqtts://可以连上,wss://连不上

EMQX版本:5.1.4
操作系统:Windows Server 2022 Datacenter
使用以下Nginx配置负载均衡
EMQX
stream {
# emqx_dashboard
upstream stream_backend_emqx_dashboard {
zone tcp_servers 64k;
#hash $remote_addr;
server emqx.vikingx.top:18083 max_fails=2 fail_timeout=30s;
}

server {
	listen 18084;
	proxy_pass stream_backend_emqx_dashboard;
	#proxy_protocol on;
	proxy_buffer_size 4k;
	
	ssl_handshake_timeout 15s;
	ssl_certificate      ssl/emqx.vikingx.top_bundle.crt;
    ssl_certificate_key  ssl/emqx.vikingx.top.key;
}

# emqx_tcp
upstream stream_backend_emqx_tcp {
	zone tcp_servers 64k;
	#hash $remote_addr;
	server emqx.vikingx.top:1883 max_fails=2 fail_timeout=30s;
}

server {
	listen 1884 ssl;
	proxy_pass stream_backend_emqx_tcp;
	proxy_protocol on;
	proxy_buffer_size 4k;
	
	ssl_handshake_timeout 15s;
	ssl_certificate      ssl/emqx.vikingx.top_bundle.crt;
    ssl_certificate_key  ssl/emqx.vikingx.top.key;
}

server {
	listen 1885;
	proxy_pass stream_backend_emqx_tcp;
	proxy_protocol on;
	proxy_buffer_size 4k;
}

# emqx_ws
upstream stream_backend_emqx_ws {
	zone tcp_servers 64k;
	#hash $remote_addr;
	server emqx.vikingx.top:8083 max_fails=2 fail_timeout=30s;
}

server {
	listen 8084 ssl;
	proxy_pass stream_backend_emqx_ws;
	proxy_protocol on;
	proxy_buffer_size 4k;
	
	ssl_handshake_timeout 15s;
	ssl_certificate      ssl/emqx.vikingx.top_bundle.crt;
    ssl_certificate_key  ssl/emqx.vikingx.top.key;
}

server {
	listen 8085;
	proxy_pass stream_backend_emqx_ws;
	proxy_protocol on;
	proxy_buffer_size 4k;
}

}

使用MQTTX连接时,mqtt://及mqtts://均可正常连接
image


而ws://及wss://均连不上
image
image

telnet emqx.vikingx.top 1883 1884 1885 8083 8084 8085均正常

emqx log:

ws 连不上感觉是可以开下 emqx 的日志追踪看看原因。
解决了 ws 的问题 在看看 wss 的原因。从刚刚贴的日志来看看起来是 ssl 配置不是很对。

如果 wss 还是链接不上,1) 可以尝试贴下这个监听器的配置,2)抓包分析下握手失败的原因

监听器配置:



ws 能链接了么?