1. 在http节点下,加入upstream节点。

upstream linuxidc { 
      server 10.0.6.108:7080; 
      server 10.0.0.85:8980; 
}

  2.  将server节点下的location节点中的proxy_pass配置为:http:// + upstream名称,即“
http://linuxidc”.


location / { 
            root  html; 
            index  index.html index.htm; 
            proxy_pass http://linuxidc; 
}

###################################################

server {

    listen       8000;
    location / {
   proxy_pass http://10.1.166.216:9999/;
        index  index.html index.htm;
    }
    location /cdh {
   proxy_pass http://10.1.166.113:4690/;
        index  index.html login.html;
    }
    location /tomcat {
   proxy_pass http://10.1.166.171:8080/;
        index  index.html index.htm;
    }
}

1. 在http节点下,加入upstream节点。

upstream linuxidc { 
      server 10.0.6.108:7080; 
      server 10.0.0.85:8980; 
}

  2.  将server节点下的location节点中的proxy_pass配置为:http:// + upstream名称,即“
http://linuxidc”.


location / { 
            root  html; 
            index  index.html index.htm; 
            proxy_pass http://linuxidc; 
}

###################################################

server {

    listen       8000;
    location / {
   proxy_pass http://10.1.166.216:9999/;
        index  index.html index.htm;
    }
    location /cdh {
   proxy_pass http://10.1.166.113:4690/;
        index  index.html login.html;
    }
    location /tomcat {
   proxy_pass http://10.1.166.171:8080/;
        index  index.html index.htm;
    }
}

相关文章:

  • 2021-10-14
  • 2021-09-24
  • 2022-12-23
  • 2022-01-08
  • 2021-06-11
  • 2021-07-29
猜你喜欢
  • 2021-09-07
  • 2021-07-17
  • 2022-12-23
  • 2021-11-05
  • 2021-06-09
  • 2022-12-23
相关资源
相似解决方案