方案一
1.同源访问链接,增加特殊标识段落进行访问
2.中间的nginx根据标识段落进行转发
配置示例:
location /kkfile/ {
rewrite ^/kkfile(/.*)$ $1 break; # 去除请求地址中,多余的特殊段落标识 kkfile
proxy_pass http://10.21.1.56:8012;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
3.设置kkfileview的配置文件,修改其KK_BASE_URL参数,使其变成同源链接+特殊标识段落
4.用 echo "10.1.1.1 aaa.com" >> /etc/hosts 配置其容器内部的hosts文件
方案二
参考其官网 https://kkview.cn/zh-cn/docs/config.html 中的 base.url 部分的修改意见,修改2个参数。