From e71003dbe0b95b0a8fec0b8800d546976c1b311c Mon Sep 17 00:00:00 2001 From: Georg Krause Date: Sat, 22 Oct 2022 15:45:16 +0200 Subject: [PATCH] refactor(front): Untangle Front- and Backend Part-of: --- .../serve-frontend-without-middleware.refactoring | 2 ++ deploy/nginx.template | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changes/changelog.d/serve-frontend-without-middleware.refactoring diff --git a/changes/changelog.d/serve-frontend-without-middleware.refactoring b/changes/changelog.d/serve-frontend-without-middleware.refactoring new file mode 100644 index 000000000..42d7469b4 --- /dev/null +++ b/changes/changelog.d/serve-frontend-without-middleware.refactoring @@ -0,0 +1,2 @@ +Instead of requesting the right spa content from the API using a middleware we now serve the +Frontend directly with nginx and only proxy-forward for API endpoints diff --git a/deploy/nginx.template b/deploy/nginx.template index 8527e320b..3a49f504e 100644 --- a/deploy/nginx.template +++ b/deploy/nginx.template @@ -83,16 +83,17 @@ server { text/x-cross-domain-policy; # end of compression settings - location / { + location /api/ { include /etc/nginx/funkwhale_proxy.conf; # This is needed if you have file import via upload enabled. client_max_body_size ${NGINX_MAX_BODY_SIZE}; proxy_pass http://funkwhale-api/; } - location /front/ { + location / { alias ${FUNKWHALE_FRONTEND_PATH}/; expires 1d; + try_files $uri $uri/ /index.html; } location = /front/embed.html {