原因:vue项目的路径时虚拟路径,并不存在,所以用nginx去请求请求不到,所以vue项目做了两部调整:

1、所有的请求后端接口地址前端写死

2、nginx里把所有的接口转发后端删掉,并添加以下内容 

        location / {
	   try_files $uri $uri/ @router;
            index index.html;
        }
	location @router {
            rewrite ^.*$ /index.html last;
        }

  

相关文章:

  • 2022-01-16
  • 2022-12-23
  • 2022-02-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2021-09-08
  • 2021-06-09
  • 2022-12-23
  • 2021-08-14
相关资源
相似解决方案