diff --git a/Dockerfile b/Dockerfile index 1ba7f70..de64c90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,6 @@ ADD nginx-proxy-security-headers.conf /etc/nginx/proxy-security-headers.conf ADD nginx-fem-project-redirects.conf /etc/nginx/fem-project-redirects.conf ADD nginx-pfe-redirects.conf /etc/nginx/pfe-redirects.conf ADD nginx-pfe-staging-redirects.conf /etc/nginx/pfe-staging-redirects.conf -ADD nginx-fem-staging-redirects.conf /etc/nginx/fem-staging-redirects.conf ADD nginx-s3-proxy-headers.conf /etc/nginx/s3-proxy-headers.conf ADD nginx-az-proxy-headers.conf /etc/nginx/az-proxy-headers.conf ADD sites/ /etc/nginx/sites/ diff --git a/nginx-fem-staging-redirects.conf b/nginx-fem-staging-redirects.conf deleted file mode 100644 index 77dfa53..0000000 --- a/nginx-fem-staging-redirects.conf +++ /dev/null @@ -1,96 +0,0 @@ -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)/.+?$ { - resolver 1.1.1.1; - proxy_pass $fe_project_uri; - proxy_set_header Host $fe_project_host; - - 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 { - 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 Get Involved pages -location /get-involved { - 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 Projects app routes for project index page (optional trailing slash) -location ~* ^/projects/[\w-]*?/[\w-]+?/?$ { - resolver 1.1.1.1; - proxy_pass $fe_project_uri; - proxy_set_header Host $fe_project_host; - - include /etc/nginx/proxy-security-headers.conf; -} - -# FEM Projects app routes for project index page with locale (optional trailing slash) -location ~* "^/projects/[[:alpha:]]{2,3}(?:-[[:alnum:]]{0,4})?/[\w-]*?/[\w-]+?/?$" { - resolver 1.1.1.1; - proxy_pass $fe_project_uri; - proxy_set_header Host $fe_project_host; - - include /etc/nginx/proxy-security-headers.conf; -} - -# FEM Projects app routes for project index page with the test locale (optional trailing slash) -location ~* "^/projects/test/[\w-]*?/[\w-]+?/?$" { - resolver 1.1.1.1; - proxy_pass $fe_project_uri; - proxy_set_header Host $fe_project_host; - - include /etc/nginx/proxy-security-headers.conf; -} - -# FEM projects app: home,about and classify index pages, with optional locale -location ~* ^/projects/(?:[\w-]*?/)?[\w-]*/[\w-]+/(?:(classify|about)(?:/.+?)?)?/?$ { - resolver 1.1.1.1; - proxy_pass $fe_project_uri; - proxy_set_header Host $fe_project_host; - - 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; -} diff --git a/sites/frontend.preview.zooniverse.org.conf b/sites/frontend.preview.zooniverse.org.conf index d9d6f1e..66a7e89 100644 --- a/sites/frontend.preview.zooniverse.org.conf +++ b/sites/frontend.preview.zooniverse.org.conf @@ -95,6 +95,15 @@ server { return 301 /projects/laac-lscp/maturity-of-baby-sounds$1$2$is_args$query_string; } + # Use a preferential prefix to route all projects to FEM + location ^~ /projects { + resolver 1.1.1.1; + proxy_pass $fe_project_uri; + proxy_set_header Host $fe_project_host; + + include /etc/nginx/proxy-security-headers.conf; + } + # fe-root staging app location / { resolver 1.1.1.1;