nginx解决vue二级目录刷新404的问题
将下面代码放在server区适当的位置
# 【自用】解决二级目录刷新出现404页面问题
location / {
root /www/stocker;
try_files $uri $uri/ @router;
index index.html;
#解决控制台405报错问题
error_page 405 =200 $request_uri;
}
location @router {
rewrite ^.*$ /index.html last;
}
# api绑定
location /stock/api/ {
proxy_pass http://stocker.test.com:8016/stock/api/;
}


