vue官方给的例子
打开nginx.conf,配置对应信息
location / {
root c:\User\xxx\xxxx\xxx\dist;
index index.html index.htm;
try_files $uri $uri/ @router;#解决刷新404
}
location @router{
rewrite ^.*$ /index.html last;#Vue项目路由不是真实存在
}
检查配置文件是否配置正确,并运行nginx
nginx -t -c D:\nginx-1.6.1\conf\nginx.conf
start nginx#运行nginx