From 05cc9f5ef41f7b4f683d1810e6b6dd301532cd3f Mon Sep 17 00:00:00 2001 From: Mark Bouslog Date: Thu, 18 Apr 2024 12:22:11 -0500 Subject: [PATCH] Add fe-root to FEM staging redirects (#343) --- nginx-fem-staging-redirects.conf | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/nginx-fem-staging-redirects.conf b/nginx-fem-staging-redirects.conf index 2dd451b..2e918d1 100644 --- a/nginx-fem-staging-redirects.conf +++ b/nginx-fem-staging-redirects.conf @@ -1,7 +1,9 @@ set $fe_project_uri "https://fe-project.preview.zooniverse.org"; set $fe_content_pages_uri "https://fe-content-pages.preview.zooniverse.org"; +set $fe-root_uri "https://fe-root.preview.zooniverse.org"; set $fe_project_host "fe-project.preview.zooniverse.org"; set $fe_content_pages_host "fe-content-pages.preview.zooniverse.org"; +set $fe-root_host "fe-root.preview.zooniverse.org"; # Project app data and static files location ~* ^/projects/(?:_next|assets)/.+?$ { @@ -21,6 +23,15 @@ location ~* ^/about/(?:_next|assets)/.+?$ { include /etc/nginx/proxy-security-headers.conf; } +# Root app data and static files +location ~* ^/(?:_next|assets)/.+?$ { + resolver 1.1.1.1; + proxy_pass $fe-root_uri; + proxy_set_header Host $fe-root_host; + + include /etc/nginx/proxy-security-headers.conf; +} + # Zooniverse About pages location ~* ^/about/(?:team|publications)/?$ { resolver 1.1.1.1; @@ -65,3 +76,21 @@ location ~* ^/projects/(?:[\w-]*?/)?[\w-]*/[\w-]+/(?:(classify|about)(?:/.+?)?)? include /etc/nginx/proxy-security-headers.conf; } + +# FEM Root app routes for users pages (optional trailing slash) +location ~* ^/users/[\w-]+/?$ { + resolver 1.1.1.1; + proxy_pass $fe-root_uri; + proxy_set_header Host $fe-root_host; + + include /etc/nginx/proxy-security-headers.conf; +} + +# FEM Root app routes for user groups pages (optional trailing slash) +location ~* ^/groups/[\w-]+/?$ { + resolver 1.1.1.1; + proxy_pass $fe-root_uri; + proxy_set_header Host $fe-root_host; + + include /etc/nginx/proxy-security-headers.conf; +}