Refresh page 404 in Vue router history mode

Time:2020-4-26

The solution of many predecessors has not been solved. The configuration is similar to the following
`

    location / {
        root   html;
        index  index.html index.htm; 
        try_files $uri $uri/ /index.html;
    }

`
Always report 500.
In the end, the research found that the case that seniors had to solve was to deploy a front-end project under nginx, while my case was that there were multiple front-end projects under nginx. After a little adjustment of the path, the problem was solved.
The specific method is as follows (only the nginx.conf file of nginx needs to be modified. This modification does not affect the routing default of other front-end projects, only my own projects are processed):
`
server {

listen       8090;
    server_name  localhost;

    #charset koi8-r;

    #access_log  logs/host.access.log  main;

    location / {
        root   html;
        index  index.html index.htm; 
    }
    
    #Solve the problem of refreshing page 404 in routing history mode
    location /webName/ {
        root   html;
        index  index.html index.htm; 
          try_files $uri $uri/ /webName/index.html;
    }
    ....

}
`