Server Load balancer
Server Load balancer is a server set composed of multiple servers in a symmetric manner. Each server is equivalent,
Reverse Proxy
A proxy server is used to receive requests from the Internet and then forward the requests to an internal server.
Common Load Balancing
1. manually select the download site,
2. disadvantages of DNS round robin: low reliability and load imbalance
3. layer-4 and layer-7 Load Balancing Devices
The configuration is as follows:
Server Cluster upstream 192.168.0.4 {# server cluster name server 172.16.21.13: 8081 Weight = 1; # server configuration weight indicates weight. A higher weight indicates a higher probability of allocation. Server 192.168.1.186: 8081 Weight = 1; server 192.168.0.101: 80 Weight = 5; server 192.168.0.102: 80 Weight = 1 ;}
Server Configuration
Location/{# the backend returns an error such as 502 404 execution timeout. The request is automatically forwarded to proxy_next_upstream http_502 http_404 error timeout invalid_header; proxy_pass http: // 192.168.0.4; # Autoindex on; # proxy_redirect default; proxy_set_header host $ host; proxy_hide_header server; # Hide header proxy_set_header X-powered-by nginx; index index.html ;}
HTTP upstream Module
The upstream module is the main module of the nginx Load Balancing module. It provides a simple method to achieve load balancing between the client and the IP.
Server commands
Weight refers to the weight of the server. The higher the weight, the more requests are allocated to the server.
Configuration and optimization of nginx load balancing and reverse proxy