要在nginx.conf文件中配置try_files,新增一個(gè)location ,其中root為網(wǎng)站的目錄,如果是寶塔上面直接找到目錄復(fù)制就行
配置示例如下:
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