在 location 里加上 try_files $uri $uri/ /index.html;

具体配置如下:

server {
listen 81;
server_name project_mall;

#charset koi8-r;

#access_log logs/host.access.log main;

location / {
root study/project_mall;
index index.html index.htm;
# 解决单页面应用刷新出现403或者404错误
try_files $uri $uri/ /index.html;
}
}