server {
listen 8124;
server_name localhost;
# 这里请求路径必须是根路径,所vue的路由跳转都由@router处理【可以自行查看】
location / {
root /home/ls_test/dist; # windows 写法 root D://arcgis//furchaos-dist//dist;
index index.html index.htm;
try_files $uri &uri/ @router;
}
#配套写法
location @router{
rewrite ^.*$ /index.html last;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}