/**PageBeginHtml Block Begin **/ /***自定义返回顶部小火箭***/ /*生成博客目录的JS 开始*/ /*生成博客目录的JS 结束*/

Nginx记录-Proxy_pass多个应用配置(转载)

Nginx记录-Proxy_pass多个应用配置(转载)

 

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;
    }
}
posted @ 2021-12-20 10:42  一品堂.技术学习笔记  阅读(1675)  评论(0编辑  收藏  举报