nginx tcp 转发实现ip_hash和ssl

  sre

e8ba402665ac2bef88f006df02300c7a.gif

stream {
    upstream backend {
        hash $remote_addr consistent;
        server 192.168.59.3:9344;
        server 192.168.59.3:9345;
    }
    server {
        listen 9344 ssl;
        ssl_certificate        /data/keys/CAcert.pem;
        ssl_certificate_key    /data/keys/privkey.pem;
        ssl_session_cache shared:SSL:10m;
        ssl_session_timeout  2h;
        proxy_timeout 20s;
        proxy_pass backend;
    }
}

官网:https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/

LEAVE A COMMENT

Captcha Code