From 8698f2d17ce38787fa9a9cfca57d01608987c0ad Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Mon, 12 Jun 2023 15:02:25 +0200 Subject: [PATCH] fix: Make sure the SPA Manifest is fetched using the right protocol Part-of: --- changes/changelog.d/2151.bugfix | 1 + deploy/nginx.template | 3 ++- docker/nginx/conf.dev | 3 ++- front/docker/funkwhale.conf.template | 3 ++- 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 changes/changelog.d/2151.bugfix diff --git a/changes/changelog.d/2151.bugfix b/changes/changelog.d/2151.bugfix new file mode 100644 index 000000000..2ec7d4b91 --- /dev/null +++ b/changes/changelog.d/2151.bugfix @@ -0,0 +1 @@ +Make sure the SPA Manifest is fetched using the right protocol (#2151) diff --git a/deploy/nginx.template b/deploy/nginx.template index c01c2eb05..60a7b9b19 100644 --- a/deploy/nginx.template +++ b/deploy/nginx.template @@ -163,6 +163,7 @@ server { } location /manifest.json { - return 302 /api/v1/instance/spa-manifest.json; + # If the reverse proxy is terminating SSL, nginx gets confused and redirects to http, hence the full URL + return 302 ${FUNKWHALE_PROTOCOL}://${FUNKWHALE_HOSTNAME}/api/v1/instance/spa-manifest.json; } } diff --git a/docker/nginx/conf.dev b/docker/nginx/conf.dev index b92f621d2..6587d81a5 100644 --- a/docker/nginx/conf.dev +++ b/docker/nginx/conf.dev @@ -163,7 +163,8 @@ http { } location /manifest.json { - return 302 /api/v1/instance/spa-manifest.json; + # If the reverse proxy is terminating SSL, nginx gets confused and redirects to http, hence the full URL + return 302 ${FUNKWHALE_PROTOCOL}://${FUNKWHALE_HOSTNAME}/api/v1/instance/spa-manifest.json; } } } diff --git a/front/docker/funkwhale.conf.template b/front/docker/funkwhale.conf.template index de0b993ab..3e45379b4 100644 --- a/front/docker/funkwhale.conf.template +++ b/front/docker/funkwhale.conf.template @@ -128,6 +128,7 @@ server { } location /manifest.json { - return 302 /api/v1/instance/spa-manifest.json; + # If the reverse proxy is terminating SSL, nginx gets confused and redirects to http, hence the full URL + return 302 ${FUNKWHALE_PROTOCOL}://${FUNKWHALE_HOSTNAME}/api/v1/instance/spa-manifest.json; } }