NGINX_logo_rgb-01

Cấu hình load balancer fail over cho nginx.

Defaul nginx load balancing : http { upstream myapp1 { server srv1.example.com; server srv2.example.com; server srv3.example.com; } server { listen 80; location / { proxy_pass http://myapp1; } } } Ví dụ bạn có file nginx như sau: upstream mywebsite1 { least_conn; server xxx.xxx.xxx.20 weight=1 max_fails=3 fail_timeout=15s; server xxx.xxx.xxx.21 weight=1 max_fails=3 fail_timeout=15s; } Cấu hình trên[...]