nginx负载均衡

只需在http{}里面加入以下代码

upstream qingshouba.com{
    server 114.55.178.97:8080 weight=5;
    server 114.55.178.97:8090 weight=5;
    }
    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
      proxy_pass http://qingshouba.com;  
        
}

posted @ 2018-02-09 11:10  志超  阅读(76)  评论(0编辑  收藏  举报