1. Polling (default)
Each request is assigned to a different back-end server in chronological order, and can be automatically rejected if the backend server is down.
## The default server#upstream192.168.93.128{ server192.168.1.8:80 weight=2; server192.168.93.128:8080 weight=1;}server { listen80; server_name192.168.93.128; location / { #设置主机头和客户端真实地址,以便服务器获取客户端真实IPproxy_set_header$host; proxy_set_header$remote_addr; proxy_set_header$proxy_add_x_forwarded_for; #禁用缓存proxy_bufferingoff; #反向代理的地址proxy_passhttp://192.168.93.128; }}
2, Ip_hash
Each request is allocated according to the hash result of the access IP, so that each visitor has fixed access to a back-end server that can resolve the issue.
3. Fair (third party)
The response time of the back-end server is allocated to the request, and the response time is short of priority allocation.
4. Url_hash (third Party)
Allocate the request by the hash result of the access URL so that the same URL is directed to the same back-end server, which is more efficient when the backend server is cached
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the Nginx upstream load balancing, including the stream,nginx aspects of the content, I hope that the PHP tutorial interested in a friend helpful.