stream {
upstream controller_server {
server 192.168.1.1:8080;
server 192.168.1.2:8080;
}
server {
listen 6798 ;
proxy_pass controller_server;
proxy_ssl_certificate /usr/local/nginx/conf/server.crt;
proxy_ssl_certificate_key /usr/local/nginx/conf/server.key.unsecure;
}
}
注意 如果轮询的是http的就这样配置,如果是https的地址轮询访问就要在6789后加上ssl,与proxy_ssl on;