nginx 允许访问目录,即列出目录
server {
listen 80;
server_name domain.com www.domain.com;
access_log /var/...........................;
root /path/to/root;
location / {
index index.php index.html index.htm;
}
location /somedir {
autoindex on;
}
}
禁止访问目录
location /dirdeny {
deny all;
return 403;
}