nginx配置
location / {
try_files $uri $uri/ /index.html;
}
vue history模式下nginx配置
在宝塔的网站设置中修改
server {
listen 80;
server_name testwx.wangshibo.com;
root /Data/app/xqsj_wx/dist;
index index.html;
access_log /var/log/testwx.log main;
## 注意从这里开始
location / {
try_files $uri $uri/ @router;
index index.html;
}
location @router {
rewrite ^.*$ /index.html last;
}
}
评论