nginx tcp代理后服务端能收到客户端消息,但客户端收不到服务端返回的消息。
nginx 配置如下:
stream{
upstream mqttserver{
hash $remote_addr consistent;
server 127.0.0.1:55534 max_fails=1 fail_timeout=10s;
}
server{
listen 55533 so_keepalive=on;
proxy_connect_timeout 5s;
proxy_timeout 30s;
proxy_pass mqttserver;
}
}