Nginx发布前端项目,解决F5刷新跳404问题

1. 解决方式:
  在 location 模块添加一行配置:
    try_files $uri $uri/ /index.html;
  如下:
location / {
    index index.html;
    root /opt/data/ganss-vue;
    try_files $uri $uri/ /index.html;
    expires 30d;
}

参考文章:

  https://blog.csdn.net/Tomwildboar/article/details/84293849 Nginx发布项目,刷新404【简单有效解决】

原文地址:https://www.cnblogs.com/tarencez/p/13208253.html