首页 > 其他 > 详细

开启mode="history"模式,需要服务端的支持,因为出现“刷新页面报错404”的问题;

时间:2019-12-17 18:32:22      阅读:327      评论:0      收藏:0      [点我收藏+]

mode="history"是去除链接中的‘#‘的,但是加上后页面刷新回报404错误,怎么办呢?

解决办法:只需要在nginx中最末尾加上 try_files $uri $uri/ /index.html; 即可,例如:

server {

  listen 80;

  server_name k-line-drawer.testcadae.top k-painter.testcadae.top ;
  charset utf-8;
  location / {
    autoindex on;
    root /opt/app/k_line_drawer/current;
    index index.html;
    # 加上这一句就可以.
    try_files $uri $uri/ /index.html;
  }
}

开启mode="history"模式,需要服务端的支持,因为出现“刷新页面报错404”的问题;

原文:https://www.cnblogs.com/lv-books/p/12055919.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!