nginx 配置負載均衡


    upstream testTomcat{
        #設置分權,權重越高優先訪問
        server 106.53.73.200:8888 weight=1;
        server 182.254.184.102:8888 weight=1;
    }

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        #所有請求都在這里去找分配
        location / {
            #root   html;
            index  index.html index.htm;
            #使用test分配規則,即剛剛自定義添加的upstream節點
            proxy_pass http://testTomcat/test/;
        }
 }