From 8e9ef37e93378563d0475f7de320c86acb65a3d4 Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:12:34 +0400 Subject: [PATCH] more shennanigans --- modules/server/fedi/akkoma.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/modules/server/fedi/akkoma.nix b/modules/server/fedi/akkoma.nix index 70229009..e41702ed 100644 --- a/modules/server/fedi/akkoma.nix +++ b/modules/server/fedi/akkoma.nix @@ -58,8 +58,9 @@ in { allow_relay = true; }; ":media_proxy" = { - enabled = false; - # base_url = "media.social.sako.lol"; + enabled = true; + proxy_opts = { redirect_on_failure = true; }; + base_url = "media.social.sako.lol/proxy"; }; "Pleroma.Web.Endpoint" = { url.host = "social.sako.lol"; }; "Pleroma.Upload" = { @@ -73,11 +74,23 @@ in { }; }; }; + nginx.proxyCachePath."akkoma-media-cache" = { + enable = true; + levels = "1:2"; + inactive = "720m"; + maxSize = "10g"; + useTempPath = false; + keysZoneName = "akkoma_media_cache"; + keysZoneSize = "10m"; + }; nginx.virtualHosts = { "media.social.sako.lol" = { forceSSL = true; enableACME = true; - locations."/" = { proxyPass = "http://unix:/run/akkoma/socket"; }; + locations = { + "/media" = { proxyPass = "http://unix:/run/akkoma/socket"; }; + "/proxy" = { proxyPass = "http://unix:/run/akkoma/socket"; }; + }; }; }; };