实现基于轮询的方式调度三台web
http { upstream myapp1 { server srv1.example.com; server srv2.example.com; server srv3.example.com; } server { listen 80; location / { proxy_pass http://myapp1; } } }
由于没有IP了,只能开两个
实现基于权重的方式调度三台web
upstream myapp1 { server srv1.example.com weight=3; server srv2.example.com; server srv3.example.com; }
实现基于hash的方式调用三台web
upstream myapp1 { ip_hash; server srv1.example.com; server srv2.example.com; server srv3.example.com; }