## 部署Saber >本章节以商业版展示,开源版处理方式与商业版一致,大家可以直接参考 1. 本章节以Saber为例进行部署,其实Sword方式也是一致的 2. 进入Saber根目录执行` yarn run build`,并进入dist目录,将目录文件打成压缩包 ![](https://img.kancloud.cn/2a/35/2a35c45e52eb3aeafd1278da6634843c_1912x1800.png) 3. 将压缩包上传至宝塔创建的站点根目录后点击`解压` ![](https://img.kancloud.cn/d7/36/d736940e3bb15aa2b228f6ce45c8c584_1208x594.png) ![](https://img.kancloud.cn/06/65/06650dd75e50a8194381517f1034ae7d_2286x1550.png) ![](https://img.kancloud.cn/86/9c/869c18264119b55d05f0f3174e1bc14f_2918x906.png) ![](https://img.kancloud.cn/45/f7/45f7bf00383b67fc0ad24fad908b98d4_1116x718.png) 4. 解压后目录如下 ![](https://img.kancloud.cn/21/23/2123afa3bc2ff68e8ff34eda82b0bcf7_2910x1588.png) 5. 返回站点目录点击设置,找到`伪静态`栏目,填入后端反向代理配置 ~~~shell location ^~ /api { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; rewrite ^/api/(.*)$ /$1 break; proxy_pass http://127.0.0.1:88; } ~~~ ![](https://img.kancloud.cn/19/ce/19ce580489b4da461c567e6365c1b7bd_2948x626.png) ![](https://img.kancloud.cn/c3/31/c331850e7886f71533c24bca3beaf734_1590x1468.png) 6. 如果使用saber3版本,需要额外添加如下配置 ~~~ location /{ index index.html; error_page 404 /index.html; } ~~~ ![](https://img.kancloud.cn/a9/e2/a9e217707843abae85a60063a972808e_1030x572.png) 7. 刷新地址,发现Saber正确展示,验证码也正确展示 ![](https://img.kancloud.cn/df/fc/dffc2a888f1e30a52ea83c343dbaecd2_2396x1830.png) 8. 点击登录,可以正确展示,至此部署就已经全部完工 ![](https://img.kancloud.cn/8a/b2/8ab2cc530d210a48b817af8d3e73ceab_3358x1962.png)