图片上传到服务器成功了
{"status":0,"data":{"uri":"50bf92f5-2869-4966-b8fb-976ed1c59c4e.png","url":"http://image.mmall.club/50bf92f5-2869-4966-b8fb-976ed1c59c4e.png"}}
但通过这个URL访问不了,显示404
下面是nginx配置
server {
listen 80;
autoindex on;
server_name image.mmall.club;
access_log /usr/local/nginx/logs/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 /home/ftpuser1/image/;
add_header Access-Control-Allow-Origin *;
}
}
跳转的目录可以看到图片:
[wyf@VM_0_16_centos vhost]$ cd /home/ftpuser1/image
[wyf@VM_0_16_centos image]$ ll
total 56
-rw-r--r-- 1 ftpuser1 ftpuser1 51956 Mar 16 16:43 50bf92f5-2869-4966-b8fb-976ed1c59c4e.png
[wyf@VM_0_16_centos image]$
登录后可查看更多问答,登录/注册