一:参考文档
- kkFileView官方文档:https://kkview.cn/zh-cn/index.html
- github地址:https://github.com/kekingcn/kkFileView
- docker镜像地址:https://hub.docker.com/r/keking/kkfileview
二:docker部署kkFileView
1:拉取kkFileView镜像
docker pull keking/kkfileview2:kkFileView镜像构建并运行
docker run -d --name kkfile --restart always -p 8012:8012 keking/kkfileview3:kkFileView安装验证
访问http://localhost:8012/出现如下页面表示安装成功
三:kkFileView地址配置nginx反向代理
如果站点访问的地址为https://www.test.com 想要使用 https://www.test.com/preview/来做预览,kkFileView部署在内网192.168.1.2服务器上,需要在nginx中添加反向代理如下:
location /preview { proxy_pass 192.168.1.233:8012; }然后修改kkFileView的配置文件
server.servlet.context-path = /preview base.url = https://www.test.com/preview使用docker部署的时候执行如下命令即可
docker run -d --name kkfile --restart always -p 8012:8012 -e KK_CONTEXT_PATH="/preview" -e KK_BASE_URL="https://www.test.com/preview" keking/kkfileview