mac nginx 注意事项
2019-01-17 本文已影响4人
Mylovesunshine
0:安装
brew install nginx
-
403
第二行 添加 user root owner; -
打包路径修改
默认路径:
location / {
root root;
index index.html index.htm;
}
修改路径:
location / {
root /Users/yy/Desktop/SVN/snailLabs/dist; # 项目打包后静态文件所
在路径
index index.html index.htm;
}
3.vue 打包首页 正常,其他页面404解决方法
location / {
root /Users/yy/Desktop/SVN/snailLabs/dist; # 项目打包后静态文件所
在路径
index index.html index.htm;
try_filesuri/ @router;
}
location @router {
rewrite ^.*$ /index.html last;
}