From d45ca1a0d54aa5642b47292bc95dc95f5f25f3cb Mon Sep 17 00:00:00 2001 From: Zach Wolfenbarger Date: Mon, 23 Sep 2024 10:36:21 -0500 Subject: [PATCH 1/2] Move rename 301s to redirects file --- ...rects.conf => nginx-project-redirects.conf | 36 +++++++++++++++++++ sites/www.zooniverse.org.conf | 34 +----------------- 2 files changed, 37 insertions(+), 33 deletions(-) rename nginx-fem-project-redirects.conf => nginx-project-redirects.conf (91%) diff --git a/nginx-fem-project-redirects.conf b/nginx-project-redirects.conf similarity index 91% rename from nginx-fem-project-redirects.conf rename to nginx-project-redirects.conf index 0745c2c..ca43863 100644 --- a/nginx-fem-project-redirects.conf +++ b/nginx-project-redirects.conf @@ -1,3 +1,39 @@ +# Redirects for renamed projects + +location ~* ^/projects/meredithspalmer/(cedar-creek-eyes-on-the-wild/?)(.*?)\/?$ { + return 301 /projects/forestis/$1$2$is_args$query_string; +} + +location ~* ^/projects/karilint/the-cradle-of-mankind(/?)(.*?)\/?$ { + return 301 /projects/karilint/cradle-of-humanity$1$2$is_args$query_string; +} + +location ~* ^/projects/cseidenstuecker/every-name-counts(/?)(.*?)\/?$ { + return 301 /projects/arolsen-archives/every-name-counts$1$2$is_args$query_string; +} + +location ~* ^/projects/kevinesolberg/mapping-prejudice(/?)(.*?)\/?$ { + return 301 /projects/mappingprejudice/mapping-prejudice$1$2$is_args$query_string; +} + +location ~* ^/projects/chiarasemenzin/maturity-of-baby-sounds(/?)(.*?)\/?$ { + return 301 /projects/laac-lscp/maturity-of-baby-sounds$1$2$is_args$query_string; +} + +location ~* ^/projects/sarah-middle/voyages-in-time(/?)(.*?)\/?$ { + return 301 /projects/toolsofknowledge/voyages-in-time$1$2$is_args$query_string; +} + +location ~* ^/projects/rsengar/pulsar-seekers(/?)(.*?)\/?$ { + return 301 /projects/rsengar/einstein-at-home-pulsar-seekers$1$2$is_args$query_string; +} + +location ~* ^/projects/hughdickinson/superwasp-black-hole-hunters(/?)(.*?)\/?$ { + return 301 /projects/cobalt-lensing/black-hole-hunters$1$2$is_args$query_string; +} + +# FEM project redirects + location ~* ^/projects/(?:[\w-]*?/)?zookeeper/galaxy-zoo-weird-and-wonderful/?(?:(classify|about)(?:/.+?)?)?/?$ { resolver 1.1.1.1; proxy_pass $fe_project_uri; diff --git a/sites/www.zooniverse.org.conf b/sites/www.zooniverse.org.conf index 4522d63..9d04507 100644 --- a/sites/www.zooniverse.org.conf +++ b/sites/www.zooniverse.org.conf @@ -3,7 +3,7 @@ server { set $fe_project_host "fe-project.zooniverse.org"; include /etc/nginx/ssl.default.conf; - include /etc/nginx/fem-project-redirects.conf; + include /etc/nginx/project-redirects.conf; include /etc/nginx/pfe-redirects.conf; server_name www.zooniverse.org; @@ -76,38 +76,6 @@ server { return 301 /about/contact; } - location ~* ^/projects/meredithspalmer/(cedar-creek-eyes-on-the-wild/?)(.*?)\/?$ { - return 301 /projects/forestis/$1$2$is_args$query_string; - } - - location ~* ^/projects/karilint/the-cradle-of-mankind(/?)(.*?)\/?$ { - return 301 /projects/karilint/cradle-of-humanity$1$2$is_args$query_string; - } - - location ~* ^/projects/cseidenstuecker/every-name-counts(/?)(.*?)\/?$ { - return 301 /projects/arolsen-archives/every-name-counts$1$2$is_args$query_string; - } - - location ~* ^/projects/kevinesolberg/mapping-prejudice(/?)(.*?)\/?$ { - return 301 /projects/mappingprejudice/mapping-prejudice$1$2$is_args$query_string; - } - - location ~* ^/projects/chiarasemenzin/maturity-of-baby-sounds(/?)(.*?)\/?$ { - return 301 /projects/laac-lscp/maturity-of-baby-sounds$1$2$is_args$query_string; - } - - location ~* ^/projects/sarah-middle/voyages-in-time(/?)(.*?)\/?$ { - return 301 /projects/toolsofknowledge/voyages-in-time$1$2$is_args$query_string; - } - - location ~* ^/projects/rsengar/pulsar-seekers(/?)(.*?)\/?$ { - return 301 /projects/rsengar/einstein-at-home-pulsar-seekers$1$2$is_args$query_string; - } - - location ~* ^/projects/hughdickinson/superwasp-black-hole-hunters(/?)(.*?)\/?$ { - return 301 /projects/cobalt-lensing/black-hole-hunters$1$2$is_args$query_string; - } - # Default to fe-root app location / { resolver 1.1.1.1; From 4ed678700007e46e3848048fa0029b625be00338 Mon Sep 17 00:00:00 2001 From: Zach Wolfenbarger Date: Mon, 23 Sep 2024 10:36:38 -0500 Subject: [PATCH 2/2] Use renamed redirect file --- Dockerfile | 2 +- sites/frontend.preview.zooniverse.org.conf | 2 +- sites/static-staging.zooniverse.org.conf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index de64c90..1a8bd56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ ADD nginx.conf /etc/nginx/nginx.conf ADD nginx-redirects.conf /etc/nginx/redirects.conf ADD nginx-proxy.conf /etc/nginx/proxy.conf 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-project-redirects.conf /etc/nginx/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-s3-proxy-headers.conf /etc/nginx/s3-proxy-headers.conf diff --git a/sites/frontend.preview.zooniverse.org.conf b/sites/frontend.preview.zooniverse.org.conf index 66a7e89..cab0eb0 100644 --- a/sites/frontend.preview.zooniverse.org.conf +++ b/sites/frontend.preview.zooniverse.org.conf @@ -3,7 +3,7 @@ server { set $fe_project_host "fe-project.preview.zooniverse.org"; include /etc/nginx/ssl.default.conf; - include /etc/nginx/fem-project-redirects.conf; + include /etc/nginx/project-redirects.conf; include /etc/nginx/pfe-staging-redirects.conf; server_name frontend.preview.zooniverse.org; diff --git a/sites/static-staging.zooniverse.org.conf b/sites/static-staging.zooniverse.org.conf index 689bb11..27edac7 100644 --- a/sites/static-staging.zooniverse.org.conf +++ b/sites/static-staging.zooniverse.org.conf @@ -3,7 +3,7 @@ server { set $fe_project_host "fe-project.preview.zooniverse.org"; include /etc/nginx/ssl.default.conf; - include /etc/nginx/fem-project-redirects.conf; + include /etc/nginx/project-redirects.conf; include /etc/nginx/pfe-staging-redirects.conf; server_name static-staging.zooniverse.org;