Back

vuejs - history模式下的nginx部署

发布时间: 2019-11-03 22:16:00

history 模式比传统的hash模式看起来,非常正常. 没有了#

参考:https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations

跟传统一样配置好之后, 增加try 就可以了

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;    
  }
}

Back