通过Nginx进行转发时加入要访问的地址
location ~* \.(mp4|xls)$ { #访问资源的前缀或者路径无关
if ($request_filename ~* ^.*?\.(txt|pdf|doc|xls)$){
add_header Content-Disposition: 'attachment;';
}
proxy_pass http://IP地址; #这个是必要的
}
`
vue前端Nginx反向代理访问静态资源
location ~/虚拟路径/.*\.(|gif|jpg|jpeg|png)$ {
client_max_body_size 1024M;
root 你的资源路径;
proxy_set_header Host $host;
proxy_pass http://IP;
}
百度了很多,都没相关问题的解决方案,在此记录一下