Once the package is online, there will be a problem when it is refreshed
I checked a lot of articles and said that it was caused by hash mode, but it was not. The history mode refresh will be 404,
Official website solution, in nginx.conf Document addition
location / {
try_files $uri $uri/ /index.html;
}
Then the above problem will occur because JS file 404 is forcibly converted to index.html
The JS file does not recognize < so it causes problems
So optimize the lower and upper configuration
Change the code in the upper part of {} to the code below to solve the problem perfectly
rewrite ^.+(?<!js|css|png|map)$ /index.html break;