Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate redirects #379

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 36 additions & 0 deletions nginx-fem-project-redirects.conf → nginx-project-redirects.conf
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sites/frontend.preview.zooniverse.org.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion sites/static-staging.zooniverse.org.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
34 changes: 1 addition & 33 deletions sites/www.zooniverse.org.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down