亚洲一区亚洲二区亚洲三区,国产成人高清在线,久久久精品成人免费看,999久久久免费精品国产牛牛,青草视频在线观看完整版,狠狠夜色午夜久久综合热91,日韩精品视频在线免费观看

nginx目錄列表和目錄訪問權限設置 -電腦資料

電腦資料 時間:2019-01-01 我要投稿
【www.ishadingyu.com - 電腦資料】

    1.目錄列表(directory listing)

    nginx讓目錄中的文件以列表的形式展現只需要一條指令

    autoindex on;

    autoindex可以放在location中,只對當前l(fā)ocation的目錄起作用,

nginx目錄列表和目錄訪問權限設置

。你也可以將它放在server指令塊則對整個站點都起作用;蛘叻诺絟ttp指令塊,則對所有站點都生效。

    下面是一個簡單的例子:

    server {

    listen 80;

    server_name domain.com ;

    access_log /var/...........................;

    root /path/to/root;

    location / {

    index index.php index.html index.htm;

    }

    location /somedir {

    autoindex on;

    }

    }2.nginx禁止訪問某個目錄

    跟Apache的Deny from all類似,nginx有deny all指令來實現,

電腦資料

nginx目錄列表和目錄訪問權限設置》(http://www.ishadingyu.com)。

    禁止對叫dirdeny目錄的訪問并返回403 Forbidden,可以使用下面的配置:

    location /dirdeny {

    deny all;

    return 403;

    }

最新文章