我想实现 tstwx.bolineyecare.com/2.jpeg, 访问的是我服务器 /home/data/wx-webview/checkin/dist 目录下的图片。 但是当我访问的时候图片显示不了,状态码 200,不知道我的问题出在哪里啦。
server {
listen 443;
server_name tstwx.bolineyecare.com;
root /home/data/wx-webview/;
location /checkin/{
alias /home/data/wx-webview/checkin/dist/;
#try_files $uri/ $uri/;
autoindex on;
}
location / {
try_files $uri $uri/ @router;
index index.htm index.html;
}
location @router {
add_header Cache-Control no-store;
rewrite ^.*$ /index.html last;
}
location /statics/ {
# add_header Cache-Control no-store;
valid_referers none blocked *.bolineyecare.com;
if ($invalid_referer) {
return 403;
}
alias /data/statics/;
expires 365d;
}
location /~\.(jpg|jpeg|gif|png|ico|css|js|pdf|txt)$ {
root /home/data/wx-webview/checkin/dist/;
expires -1;
}
}