Thinkphp5 vue前端页面代码刷新报404错误

用thinkphp5开发后端,前端用vue.js开发前端,前端打包的时候用的是history的模式;
把前端代码放到public文件夹下,刷新就报404的错误!

nginx配置文件

location / {
root E:/www/doctorLink/public;
index index.php index.html index.htm;

if (!-e $request_filename){

  rewrite  ^(.*)$  /index.php?s=$1  last;   break;

}
}

阅读 1.7k
1 个回答

最好独立出来

location /{
    root E:/www/doctorLink/public;
    index index.html;
 
    #解决404
    try_files $uri $uri/ /index.html;
  }

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题