kkFileView是一款在线预览工具,支持doc,docx,Excel,pdf,txt,zip,rar,图片预览等等
1.使用docker安装
-- 拉取镜像
docker pull keking/kkfileview
-- 启动容器
docker run -it -p 8012:8012 keking/kkfileview
-- 复制kk配置文件到本地
sudo docker cp 0a26928b835d:/opt/kkFileView-4.1.0-SNAPSHOT/config/application.properties /opt/kkfileview/
-- 修改kkFileView的配置文件如下两项
server.context-path = /preview
base.url = https://域名/preview
-- 复制配置文件到容器中
sudo docker cp /opt/kkfileview/application.properties 0a26928b835d:/opt/kkFileView-4.1.0-SNAPSHOT/config/
-- 重启容器
docker restart 容器id
2.配置nginx
# kkfileview
location /preview {
proxy_set_header Host $http_host;
proxy_read_timeout 1800s;
proxy_pass http://127.0.0.1:8012/;
}
3.访问地址:http://ip:port/preview/index