nginx负载均衡配置

#负载均衡配置

upstream testDomain {
        server 127.0.0.1:8080 weight=1;
        server 127.0.0.1:8081 weight=3;
    }

    server {
        listen       80;
        server_name  test123.com;

        #匹配的请求路径

        location / {
            root   html;
            index  index.html index.htm;

            #代理指向
            proxy_pass http://testDomain;
        }

}

常用命令

启动

直接点击Nginx目录下的nginx.exe    或者    cmd运行start nginx

nginx -s stop fast shutdown
nginx -s quit graceful shutdown
nginx -s reload changing configuration,starting new worker processes with a new configuration,graceful shutdown of old worker processes
nginx -s reopen re-opening log files
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
THE END
分享
二维码
< <上一篇
下一篇>>