nginx的conf目录下的nginx.conf增加配置
server {
listen 80;
#其他配置.......
#增加的配置,注意 / 要改成自己的项目目录,我这里是域名直接访问,没有项目名,所以直接是斜杠
location / {
try_files $uri $uri/ @router;
index index.html index.htm;
}
location @router {
rewrite ^.*$ /index.html;
}
}