我仍然遇到这个问题。我查看了一下代码,正如我所料,代码实际请求的是 https://avatars.discourse-cdn.com/#{params[:version]}/letter/#{params[:letter]}/#{params[:color]}/#{params[:size]}.png。在 Discourse 容器内,我可以直接 wget 该文件并获得有效的 PNG。例如:https://avatars.discourse-cdn.com/v4/letter/b/bcef8e/48.png → https://forum.pkp.sfu.ca/48.png
在 production.log 中,它显示图像已成功下载,据称是这样的:
Started GET "/presence/get?channels%5B%5D=%2Fdiscourse-presence%2Freply%2F88689&channels%5B%5D=%2Fdiscourse-presence%2Fwhisper%2F88689" for 172.17.1.79 at 2024-07-09 19:59:01 +0000
Processing by PresenceController#get as JSON
Parameters: {"channels"=>["/discourse-presence/reply/88689", "/discourse-presence/whisper/88689"]}
Processing by UserAvatarsController#show_proxy_letter as PNG
Parameters: {"version"=>"v4", "letter"=>"b", "color"=>"bcef8e", "size"=>"48"}
Completed 200 OK in 14ms (Views: 0.5ms | ActiveRecord: 0.0ms | Allocations: 3095)
Completed 418 in 9ms (Views: 0.4ms | ActiveRecord: 0.0ms | Allocations: 1680)
所以不知何故,我仍然得到一个空白图像。也许它没有使用 HTTP_PROXY 或 HTTPS_PROXY 或其他东西。
在 site_settings.yml 中,它说默认的 letter_avatar_proxy url 是:" /letter_avatar_proxy/v4/letter/{first_letter}/{color}/{size}.png",当我右键单击其中一个图像以获取 URL 时,它是(正确地?)https://forum.pkp.sfu.ca/letter_avatar_proxy/v4/letter/b/bcef8e/48.png