实现效果
浏览器输入http://ip/edu/a.html,负载均衡效果,平均分配到8080和8081端口中。
......
......
#gzip on;
upstream myserver{
server localhost:8080;
server localhost:8081;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://myserver;
root html;
index index.html index.htm;
}
}
......
......