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;
}
}