vue项目打包部署到nginx服务器上出现了跨域问题,现在跨域问题通过配置nginx反向代理解决了,但是接口中报404错误,如何解决?

vue项目打包部署到nginx服务器出现问题

vue项目打包部署到nginx服务器上出现了跨域问题,现在跨域问题通过配置nginx反向代理解决了,但是接口中报404错误,本地运行的时候没有任何问题

报错截图

img

nginx反向代理配置

location /api {
      proxy_pass https://gw.wozaixiaoyuan.com;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  
    location / {
      # 配置您的Vue应用的根目录
      root /www/wwwroot/guliblog.top;
      try_files $uri $uri/ /index.html;
    }

发一下你本地成功访问的路径,还有配置跨域后访问的路径