nginx负载均衡配置

发布时间:2022-06-26 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了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 stopfast shutdown
nginx -s quitgraceful shutdown
nginx -s reloadchanging configuration,starting new worker processes with a new configuration,graceful shutdown of old worker processes
nginx -s reopenre-opening log files

脚本宝典总结

以上是脚本宝典为你收集整理的nginx负载均衡配置全部内容,希望文章能够帮你解决nginx负载均衡配置所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: