step1.配置dumi非根目录部署
- blog.umirc.ts ```javascript import { defineConfig } from ‘dumi’;
export default defineConfig({ title: ‘Site Name’, mode: ‘site’, // more config: https://d.umijs.org/config // base: ‘/‘, publicPath: ‘/two/‘, exportStatic: {}, // 将所有路由输出为 HTML 目录结构,以免刷新页面时 404 // 其他配置 });
打包dumi,然后放到下面nginx指定文件夹<br />`npm run build`
<a name="E46OX"></a>
### step2.配置nginx
```javascript
http {
server {
location /one {
alias /root/one;
index index.html index.htm;
}
location /two {
alias /root/two;
index index.html index.htm;
}
location /music {
alias /root/music;
index index.html index.htm;
}
}
}
修改配置后要重加载nginxnginx -s reload