若依框架部署后,后台数据除了图片其他都可以显示,而且图片可以上传,只是不能回显,这是因为文件在上传后,请求访问后台地址会根据profile进行配置,需要自己配置代理。
在Nginx配置中注释或删除下面的所有:
# location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log /dev/null;
}
# location ~ .*\.(js|css)?$
{
expires 12h;
error_log off;
access_log /dev/null;
}
添加下面配置:
location /profile/ {
# 静态资源配置方式二:指向目录,对应后台`application.yml`中的`profile`配置目录一致
alias /home/admin/app/attachments/;
}
或者
location /profile/ {
proxy_pass http://127.0.0.1:8080/profile/;
#127.0.0.1:8080改成自己的服务器地址和端口
}
以上就可以成功回显了!!