若autoindex为off,会报403,但是仍可访问里面的资源
修改成on,就会自动建立索引,不再报403。
server {
listen 80;
autoindex on;
server_name www.image.imooc.com;
access_log c:/access.log combined;
index index.html index.htm index.jsp index.php; #error_page 404 /404.html;
if ( $query_string ~* ".*[\;'\<\>].*" ){
return 404;
}
location ~ /(mmall_fe|mmall_admin_fe)/dist/view/*
{
deny all;
}
location / {
root C:\ftpfile\img;
add_header Access-Control-Allow-Origin *;
}
}