nginx常用模块(目录索引模块 访问限制模块)

 

 

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

 

 

 

 

 

 

 

 

posted @ 2020-08-24 21:52  六月OvO  阅读(189)  评论(0编辑  收藏  举报