vue 在nginx上面出现刷新后404错误
解决办法:在nginx的配置文件中添加location / {root/usr/share/nginx/html/;index index.html index.htm;try_files $uri $uri/ @router;index index.html;}location ...
·
解决办法:
在nginx的配置文件中添加
location / {
root /usr/share/nginx/html/;
index index.html index.htm;
try_files $uri $uri/ @router;
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
主要是try_files这个 如果nginx重启失败,说配置有问题,去掉
location @router {
rewrite ^.*$ /index.html last;
}
然后改下 try_files $uri $uri/ @router; 为 try_files $uri $uri/ /index.html;
更多推荐
所有评论(0)