alist-org / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
42.44k stars 5.49k forks source link

文件预览功能问题 #6637

Closed 20082010 closed 3 months ago

20082010 commented 3 months ago

Please make sure of the following things

AList Version / AList 版本

v3.34.0

Driver used / 使用的存储驱动

WebDav/FTP

Describe the bug / 问题描述

由于WebDav和FTP等的特殊性,在设置WebDAV 策略中一般选择“本地代理”,但实际如果是类似nas挂载,在打开可预览文件例如图片时,点击文件名时预览的大图会显示“载入图像失败”,但实际查看到地址被调整为“http://localhost/p/*******”开头的地址

但如果选择下载文件,复制链接按钮的地址又是对的。下载按钮又是以localhost的错误主机头。这个问题困扰我好几个版本了。辛苦帮忙看一下如何调整?

Reproduction / 复现链接

https://file.mutouky.cn/cpmh-297582f30a_Jc.jpg

Config / 配置

存储挂载,非配置问题

Logs / 日志

No response

welcome[bot] commented 3 months ago

Thanks for opening your first issue here! Be sure to follow the issue template!

github-actions[bot] commented 3 months ago

See

  1. 50% #4212
  2. 50% #1493
20082010 commented 3 months ago

补充一个请求截图 image

补充一个场景,如果图片不点击文字,点击图标按钮,是可以正常预览图片的。只不过会一次性加载当前页面所有图片,容易卡服务器。

j2rong4cn commented 3 months ago

你用的什么反向代理?我用nginx没问题的。 alist文档-反向代理

20082010 commented 3 months ago

多谢提醒,之前懒,直接写了个localhost。没写$host。调整好之后都是正常的。