要在nginx.conf文件中配置try_files,新增一个location ,其中root为网站的目录,如果是宝塔上面直接找到目录复制就行
配置示例如下:
server{
listen 8888;
server_name localhost;
location / {
root /opt/kapok-element/dist;
index index.html index.htm;
try_files $uri $uri/ /index.html;
}
}
原文章地址: https://www.cnblogs.com/luoyihao/p/16004665.html