Home > Web Front-end > JS Tutorial > How to deal with refresh 404 after vue project is packaged

How to deal with refresh 404 after vue project is packaged

php中世界最好的语言
Release: 2018-03-28 17:15:29
Original
2252 people have browsed it

This time I will show you how to deal with the 404 refresh after the vue project is packaged. What are the precautions when dealing with the refresh 404 after the vue project is packaged. The following is a practical case, let's take a look.

The problem of refreshing 404 after vue packages the project Nginx configuration

server { 
  listen   80; 
  server_name localhost; 
  index index.html; 
  root /root/dist; 
  location / { 
    root /root/dist; 
    try_files $uri $uri/ /index.html =404; 
  } 
}
Copy after login

I believe you have mastered the method after reading the case in this article, please come for more exciting information Pay attention to other related articles on php Chinese website!

Recommended reading:

Solution to the problem that vue2.0 routing does not display router-view

After clicking the component in Vue The implementation method of closing the component

The above is the detailed content of How to deal with refresh 404 after vue project is packaged. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template