nginx 配置目录转发

server {
listen 80;
autoindex off;
server_name 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:ftpfileimg;
add_header Access-Control-Allow-Origin *;
}
}

root:C:ftpfileimg;后不可加\,变为C:ftpfileimg

.
原文地址:https://www.cnblogs.com/Dar-/p/9065755.html