惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
博客园_首页
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
ThreatConnect
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
H
Help Net Security
T
Threat Research - Cisco Blogs
Blog — PlanetScale
Blog — PlanetScale
A
Arctic Wolf
G
Google Developers Blog
量子位
U
Unit 42
I
InfoQ
V
V2EX
F
Fox-IT International blog
P
Privacy & Cybersecurity Law Blog
V
Visual Studio Blog
J
Java Code Geeks
大猫的无限游戏
大猫的无限游戏
C
CERT Recently Published Vulnerability Notes
博客园 - 三生石上(FineUI控件)
T
The Exploit Database - CXSecurity.com
T
Tailwind CSS Blog
SecWiki News
SecWiki News
Know Your Adversary
Know Your Adversary
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
The Hacker News
The Hacker News
Project Zero
Project Zero
Application and Cybersecurity Blog
Application and Cybersecurity Blog
月光博客
月光博客
Recent Commits to openclaw:main
Recent Commits to openclaw:main
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
G
GRAHAM CLULEY
C
Cisco Blogs
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
Recorded Future
Recorded Future
T
Tenable Blog
W
WeLiveSecurity
腾讯CDC
Stack Overflow Blog
Stack Overflow Blog
T
The Blog of Author Tim Ferriss
www.infosecurity-magazine.com
www.infosecurity-magazine.com
D
Docker
C
Cybersecurity and Infrastructure Security Agency CISA
PCI Perspectives
PCI Perspectives

博客园 - 浊浊然

css毛玻璃效果 createjs 实现场景拖动、滚轮放大缩小 createjs 实现图片拖动 node-sass 安装不上的问题 nodejs 搭建本地服务器 微信小程序,真机上接口调不通 mysql 去除字段中 空格 制表符等 用jeesite做后台开发,新写了个前端业务系统的权限问题 uniapp 打包app 用到地图相关 升级node最新版本18.x .Error: error:0308010C js 读取url中参数值 linux php 安装oci8 electron nativefier打包网址 electron-winstaller制作安装包 h5+ 上传图片(选择图片、拍照) phpword 导出word,文件已损坏问题 Vscode 右键 open with code 没有的情况,使用以下注册表脚本 - 浊浊然 PhpSpreadsheet导出excel - 浊浊然 apache https小程序android ssl error js获取url参数,以及中文乱码问题 微信js上传图片并 展示,iphone下预览
kkfileview5 安装
浊浊然 · 2026-05-28 · via 博客园 - 浊浊然

拉取最新代码:https://gitee.com/kekingcn/file-online-preview

idea打开项目,5.0版本java版本为21,maven打包会生成压缩包,上传服务器,bin目录执行startup.sh,linux会自动安装相关软件

官方文档地址:https://kkview.cn/zh-cn/docs/production.html

nginx代理配置:

location /kkfileview/ {
    proxy_pass http://127.0.0.1:8012/;
    # 核心配置:传递真实的 Host、IP 和协议信息
    proxy_set_header Host $host:$server_port;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;  # 如果是 HTTPS,这一项非常重要
    proxy_set_header X-Forwarded-Host $host;
    
    proxy_http_version 1.1;
    proxy_set_header Connection "";
}

#如果是宝塔面板,需要注释配置文件中的,其他环境也一样
# location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
# {
#     expires      30d;
#     error_log off;
#     access_log /dev/null;
# }
    
# location ~ .*\.(js|css)?$
# {
#     expires      12h;
#     error_log off;
#     access_log /dev/null; 
# }

预览地址:'https://xxxx.com/kkfileview/onlinePreview?url='+encodeURIComponent(Base64.encode('文件访问地址'))

代理访问时application.properties需要修改的地方:

# 设置基础访问地址,填写你外部访问 Nginx 的完整地址,与代理一致
base.url=https://你的域名或公网IP/kkfileview

# 信任站点白名单配置,多个用','隔开
# ⚠️ 安全提示:为防止SSRF攻击,强烈建议配置信任主机白名单
# ⚠️ 如果不配置,系统将默认拒绝所有外部文件预览请求
# 配置示例:
# trust.host = kkview.cn,yourdomain.com,cdn.example.com
# 如果需要允许所有域名(不推荐,仅用于测试环境),请设置为:
# trust.host = *
# 当前配置:默认本机测试 (正式启用请修改)
# trust.host = ${KK_TRUST_HOST:default}
trust.host = *.xxxx.com,a.xxx.com

linux中文乱码,下载如下字体包 https://kkview.cn/resource/fonts.zip 文件解压完整拷贝到Linux下的 /usr/share/fonts目录。然后依次执行mkfontscale 、mkfontdir 、fc-cache使字体生效,重启服务