Nginx記錄-Proxy_pass多個應用配置(轉載)

1. 在http節點下,加入upstream節點。html

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

  2.  將server節點下的location節點中的proxy_pass配置爲:http:// + upstream名稱,即「
http://linuxidc」.
tomcat


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

###################################################spa

server {code

    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;
    }
}
相關文章
相關標籤/搜索