p; index index.html index.htm;
}
access_log logs/access_bbs.log main;
}
server {
listen 80;
server_name www.etiantian.org;
location / {
root html/www;
index index.html index.htm;
}
access_log logs/access_www.log main;
}
}
hosts
[root@web01 conf]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
172.16.1.5 lb01
172.16.1.6 lb02
172.16.1.7 web02
#172.16.1.8 web01 www.etiantian.org bbs.etiantian.org blog.etiantian.org
#172.16.1.9 web03
172.16.1.51 db01 db01.etiantian.org
172.16.1.31 nfs01
172.16.1.41 backup
172.16.1.61 m01
10.0.0.9 www.etiantian.org bbs.etiantian.org blog.etiantian.org etiantian.org
总结
1 两个web服务器的nginx.conf 必须是一样的
2两个web都解析负载均衡服务器
3本地win hosts解析负载均衡服务器