疑问:关于nginx作为下载服务器的负载均衡配置
以下是我nginx的配置信息:
upstream down_xyz_com_cn {
server down.1.xyz.com.cn;
# server down.2.xyz.com.cn;
}
server{
listen 80;
server_name down.xyz.com.cn;
access_log /mnt/logs/down/down.log;
location /{
proxy_pass http://down_xyz_com_cn;
}
}
server{
listen 80;
server_name down.1.xyz.com.cn;
access_log /mnt/logs/down.1/down.1.log;
location /{
root /mnt/programs/resource/;
}
}
upstream backend
{ server 192.168.1.102:8080;
server 192.168.1.103:8080;
server 192.168.1.105:8080;
}
server {
listen 80;
server_name www.yuhongchun027.com;
location / {
root /var/www ;
index index.jsp index.htm index.html;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend; }
}