Merge pull request 'Fix download URLs for Mastodon exports/archives' (#564) from bugfix/mastodon_archive_download_urls into master

Reviewed-on: #564
This commit is contained in:
Râu Cao 2024-08-04 14:46:26 +00:00
commit cdedf49be3
2 changed files with 6 additions and 2 deletions

View File

@ -28,7 +28,9 @@ template "#{node['openresty']['dir']}/snippets/mastodon.conf" do
owner 'www-data'
mode 0640
variables web_root_dir: web_root_dir,
server_name: server_name
server_name: server_name,
s3_private_url: "#{node["kosmos-mastodon"]["s3_endpoint"]}/#{node["kosmos-mastodon"]["s3_bucket"]}/",
s3_public_url: "https://#{node["kosmos-mastodon"]["s3_alias_host"]}/"
notifies :reload, 'service[openresty]', :delayed
end

View File

@ -108,11 +108,13 @@ location @proxy {
proxy_pass http://mastodon_app;
proxy_buffering on;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
# https://github.com/mastodon/mastodon/issues/24380
proxy_redirect <%= @s3_private_url %> <%= @s3_public_url %>;
tcp_nodelay on;
}