阿里云服务器代金券领取(最高2000元)
https://www.aliyun.com/minisite/goods?userCode=3ls0qk0b

nginx的负载均衡配置

nginx.conf:

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
########指定转给哪个服务器##########    
upstream mynginx {
        server node3:8080;
        server node4:8080;
}
    server {
        listen       80;
        server_name  localhost;
        location / {
#########反向代理出去,要和upstream 后的地址一样#####
                proxy_pass http://mynginx/;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
upstream mynginx {
        server node3:8080;
        server node4:8080;
}
对应:
location / {
                proxy_pass http://mynginx/;
        }


 

posted @ 2020-12-16 16:21  H有何不可?  阅读(52)  评论(0编辑  收藏  举报
阿里云服务器代金券领取(最高2000元)
https://www.aliyun.com/minisite/goods?userCode=3ls0qk0b