在配置文件中添加 try_files $uri $uri/ /index.html;
server {
listen 80;
server_name www.tianxiashiguan.com tianxiashiguan.com;
access_log /data/wwwlogs/access_nginx.log combined;
root /data/wwwroot/dist/;
index index.html index.htm index.jsp;
try_files $uri $uri/ /index.html;//此处解决刷新页面出现404的问题
}