1.nginx load balancing relies on the ngx_http_upstream_module module and supports the following proxy modes:
proxy_pass: generally used for reverse proxy
fastcgi_pass: generally used for interacting with dynamic files, php, etc.
memcached_pass:
2.upstream module Write
upsrtream module name {
server abc.example.com weight=5;
You can connect domain name or ip, if you don’t add the port number, the default is 80, weight is the weight, the larger the value, the higher the weight
server abc .com:8080;
Server unix:/tmp/backend3;
Specify the socket file
}
3. Upstream module related instructions
1) It should be placed in the http tag of the configuration file
2) Upstream default algorithm It is wrr (weighted polling)
3) content-related parameters
max_fails maximum number of attempts, number of times to connect to the realserver behind
backup hot backup configuration, enable backup when all activated realservers fail
fail_timeout failure timeout, in conjunction with the above max_fails, after checking n times, wait n seconds
down the server is unavailable, use it with ip_hash
The above introduces the nginx reverse proxy-upstream module, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.