springboot+vue实现服务器文件上传出错

问题遇到的现象和发生背景

springboot整合vue部署在服务器上,上传文件跟回显文件有误,文件上传显示上传成功,但是文件不正常回显。正常在本地是正常回显的,

用代码块功能插入代码,请勿粘贴截图

##这是nginx的代理配置 /api代理的是9090端口

 server {
        listen       81;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   /home/MyVueSpringboot/dist;
            index  index.html index.htm;
        try_files $uri $uri/ /index.html;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        location /api/ {
         proxy_pass   http://localhost:9090/;
    }

这里显示说我从9090端口获得图片有误

GET http://xx:9090/files/571e6b4893f1425cb1bb0c2efcdb9617 net::ERR_CONNECTION_TIMED_OUT
运行结果及报错内容

这里我上传一张照片

img


这里浏览器network这里也是成功的

img


但是页面不回显

img


在本地的话正常显示

img

我的解答思路和尝试过的方法

我觉得是vue在写文件上传时可能地址写死了,但

export default {
  name: "Person",
  data() {
    return {
      form: {},
      filesUploadUrl: "http://" + window.server.filesUploadUrl + ":9090/files/upload"
    }
  },

img


其他功能又很正常

img

可以在生产环境,拿到正式的图片地址,看能直接访问不?