Vue routing history mode stepping on the pit record: nginx configuration solves the 404 problem

Time:2021-10-13

1. Official website recommendation

location / {
  root   /usr/local/www/dist;
  index  index.html index.htm;
  try_files $uri $uri/ /index.html;
}
2. Match errpr_ page

location /{
  root   /data/nginx/html;
  index  index.html index.htm;
  error_page 404 /index.html;
}

Reprinthttps://www.51csdn.cn/article/289.html


vue

This work adoptsCC agreement, reprint must indicate the author and the link to this article