Nginx的nginx.conf配置文件中文注释说明

2019-10-17 20:32:17于海丽

        include       /etc/nginx/mime.types;
        default_type  application/octet-stream;
        #设定日志格式
        access_log    /var/log/nginx/access.log;
 
        #省略上文有的一些配置节点
 
        #。。。。。。。。。。
 
        #设定负载均衡的服务器列表
         upstream mysvr {
        #weigth参数表示权值,权值越高被分配到的几率越大
        server 192.168.8.1x:3128 weight=5;#本机上的Squid开启3128端口
        server 192.168.8.2x:80  weight=1;
        server 192.168.8.3x:80  weight=6;
        }
 
       upstream mysvr2 {
        #weigth参数表示权值,权值越高被分配到的几率越大
 
        server 192.168.8.x:80  weight=1;
        server 192.168.8.x:80  weight=6;
        }
 
       #第一个虚拟服务器
       server {
        #侦听192.168.8.x的80端口
            listen       80;
            server_name  192.168.8.x;
 
          #对aspx后缀的进行负载均衡请求
        location ~ .*.aspx$ {
 
             root   /root;      #定义服务器的默认网站根目录位置
              index index.php index.html index.htm;   #定义首页索引文件的名称
 
              proxy_pass  http://mysvr ;#请求转向mysvr 定义的服务器列表
 
              #以下是一些反向代理的配置可删除.
 
              proxy_redirect off;