nginx load balancing

Step 1: Set up a server group

  upstream backend{ 
    #weight is the weight, if not set, the default is polling server 192
.168.98.92:8081 weight=5; server 192.168.98.100:8081 weight=5; server 192.168.98.98:8081 weight=1; }

Step 2: Set up the reverse proxy backend server

server{
  listen 80;
  server_name cx.com;
  index index.html index.php;
  location / {
    proxy_pass http://backend;
    proxy_set_header Host $host;   } }

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324646640&siteId=291194637