chenlifan

 

 

https://www.cnblogs.com/chenlifan/p/13556123.html

接上

 

1.目录索引模块   ngx_http_autoindex_module

 

[root@web02 /etc/nginx/conf.d]# vim test.conf 
server {
    listen 80;
    server_name www.test.com;

    location / {
        root /code;
        index index.html;
    }
    location /download {
        root /code;
        index index.html;
        autoindex on;
    }
}

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

[root@web02 ]# vim /etc/nginx/conf.d/test.conf 
autoindex_exact_size off;

 

 

 

[root@web02 ~]#systemctl restart nginx

 

 

 

 

 

 

 

 

 

 

 

2.访问控制模块 ngx_http_access_module

 

 

 

 

 

 

 

 

分类:

技术点:

相关文章: