stream{
upstream backend{
# hash $remote_addr consistent;
least_conn;
server 192.168.0.38:1884 weight=1;
#server 192.168.1.13:1883 weight=1;
}
server {
listen 1883 ssl;
#proxy_send_timeout 2h;
#proxy_read_timeout 2h;
proxy_connect_timeout 150s;
proxy_timeout 150s;
proxy_pass backend;
proxy_buffer_size 3M;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers AES128-SHA:AES256-SHA:RC4-SHA:DES-CBC3-SHA:RC4-MD5;
ssl_certificate ./cert/server_c.pem;
ssl_certificate_key ./cert/key.pem;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
}
}