Skip to content

Commit

Permalink
www.zooniverse.org.conf to default to fe-root app
Browse files Browse the repository at this point in the history
  • Loading branch information
zwolf committed Sep 13, 2024
1 parent 02da05a commit 9023920
Showing 1 changed file with 8 additions and 34 deletions.
42 changes: 8 additions & 34 deletions sites/www.zooniverse.org.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
server {
include /etc/nginx/ssl.default.conf;
include /etc/nginx/fem-redirects.conf;
include /etc/nginx/fem-project-redirects.conf;
include /etc/nginx/pfe-redirects.conf;

server_name www.zooniverse.org;

rewrite ^/lab-policies$ https://help.zooniverse.org/getting-started/lab-policies permanent;
Expand Down Expand Up @@ -103,40 +105,12 @@ server {
return 301 /projects/cobalt-lensing/black-hole-hunters$1$2$is_args$query_string;
}

# ensure the js and CSS assets are served on the same or subdomain
location ~ \.(js|css)$ {
resolver 8.8.8.8;
proxy_pass https://zooniversestatic.z13.web.core.windows.net/$host$request_uri;
include /etc/nginx/az-proxy-headers.conf;
}

# unsubscribe route uses redirects between panoptes and the UI code
# so needs it's own location block to handle the form submission POST
# and the GET page loading (PFE routing handles the path)
location /unsubscribe {
rewrite (?i)\.(jp(e)?g|gif|png|ico|txt|mp(3|4)|webm|og(a|g|m|v|x)|spx|opus|pdf|ttf|tar|gz|tgz|bz2|tbz2|zip)$ https://static.zooniverse.org/$host$request_uri;

resolver 8.8.8.8;
if ($request_method ~ ^(GET|HEAD)$) {
proxy_pass https://zooniversestatic.z13.web.core.windows.net/$host/;
set $proxy_host_header "zooniversestatic.z13.web.core.windows.net";
}
if ($request_method = POST) {
proxy_pass https://panoptes.zooniverse.org$request_uri;
set $proxy_host_header "panoptes.zooniverse.org";
}
proxy_set_header Host $proxy_host_header;
proxy_redirect /$host/ /;

include /etc/nginx/az-proxy-headers.conf;
}

# Default to fe-root app
location / {
rewrite (?i)\.(jp(e)?g|gif|png|ico|txt|mp(3|4)|webm|og(a|g|m|v|x)|spx|opus|pdf|ttf|tar|gz|tgz|bz2|tbz2|zip)$ https://static.zooniverse.org/$host$request_uri;

resolver 8.8.8.8;
proxy_pass https://zooniversestatic.z13.web.core.windows.net/$host/;
resolver 1.1.1.1;
proxy_pass "https://fe-root.zooniverse.org";
proxy_set_header Host fe-root.zooniverse.org;

include /etc/nginx/az-proxy-headers.conf;
include /etc/nginx/proxy-security-headers.conf;
}
}

0 comments on commit 9023920

Please sign in to comment.