nginx的基本操作

下载地址
http://nginx.org/en/download.html
 
修改对应的配置文件
/conf/nginx.conf 
-----------------------------------
upstream NET6{
        server localhost:10001;
        server localhost:10002;
        server localhost:10003;  
    }
表示 需要负载均衡的 几个 地址
listen       8080;
        server_name  localhost;
表示本地的端口号 和本身地址
      
  location / {    
            proxy_pass http://NET6;
            root   html;
            index  index.html index.htm;
        }
NET6表示对应上面负载均衡的地址 会按照循序给他们 均衡流量
 
修改完毕之后 回到根目录
执行 cmd.exe  执行下面 命令开始即可
 
 
start nginx  --开始
nginx.exe -s stop --关闭
nginx.ex -s reload --重启
 
posted @ 2022-02-23 15:55  阿飞飞阿飞  阅读(35)  评论(0编辑  收藏  举报