0
点赞
收藏
分享

微信扫一扫

nginx 负载均衡

陆佃 2022-08-02 阅读 217


示例:

#配置nginx 负载均衡
upstream www.hello.com {
server 127.0.0.1:8081 weight=1;
server 127.0.0.1:8082 weight=2;
}

#server配置
server {
listen 80;
server_name www.hello.com;

location / {
#重点是这里 和上边的域名一样
proxy_pass http://www.hello.com;
proxy_redirect default;
}
}

网址访问:​​http://www.hello.com/examples/index2.html​​

8081出现一次

8082出现俩次

 

举报

相关推荐

0 条评论