From ab521085e95d854ff4e475dae44129736c47c817 Mon Sep 17 00:00:00 2001 From: AMoonRabbit Date: Thu, 15 Jun 2023 13:13:38 +0000 Subject: [PATCH] fix(front): added "dynamic_preferences" path block to nginx fixes banner image not loading (#2149) MR: !2442 --- changes/changelog.d/2149.misc | 1 + deploy/nginx.template | 6 ++++++ docker/nginx/conf.dev | 6 ++++++ front/docker/funkwhale.conf.template | 6 ++++++ 4 files changed, 19 insertions(+) create mode 100644 changes/changelog.d/2149.misc diff --git a/changes/changelog.d/2149.misc b/changes/changelog.d/2149.misc new file mode 100644 index 000000000..342ad8a27 --- /dev/null +++ b/changes/changelog.d/2149.misc @@ -0,0 +1 @@ +Fix for banner images not being served on pods. diff --git a/deploy/nginx.template b/deploy/nginx.template index 214bc2ca4..c01c2eb05 100644 --- a/deploy/nginx.template +++ b/deploy/nginx.template @@ -132,6 +132,12 @@ server { add_header Access-Control-Allow-Origin '*'; } + # Allow direct access to only specific subdirectories in /media + location /media/dynamic_preferences/ { + alias ${MEDIA_ROOT}/dynamic_preferences/; + add_header Access-Control-Allow-Origin '*'; + } + # This is an internal location that is used to serve # media (uploaded) files once correct permission / authentication # has been checked on API side. diff --git a/docker/nginx/conf.dev b/docker/nginx/conf.dev index 29b48f2f2..b92f621d2 100644 --- a/docker/nginx/conf.dev +++ b/docker/nginx/conf.dev @@ -132,6 +132,12 @@ http { add_header Access-Control-Allow-Origin '*'; } + # Allow direct access to only specific subdirectories in /media + location /media/dynamic_preferences/ { + alias ${MEDIA_ROOT}/dynamic_preferences/; + add_header Access-Control-Allow-Origin '*'; + } + # This is an internal location that is used to serve # media (uploaded) files once correct permission / authentication # has been checked on API side. diff --git a/front/docker/funkwhale.conf.template b/front/docker/funkwhale.conf.template index 08e25c8be..de0b993ab 100644 --- a/front/docker/funkwhale.conf.template +++ b/front/docker/funkwhale.conf.template @@ -97,6 +97,12 @@ server { add_header Access-Control-Allow-Origin '*'; } + # Allow direct access to only specific subdirectories in /media + location /media/dynamic_preferences/ { + alias ${MEDIA_ROOT}/dynamic_preferences/; + add_header Access-Control-Allow-Origin '*'; + } + # This is an internal location that is used to serve # media (uploaded) files once correct permission / authentication # has been checked on API side.