From bd0fe20ee07305aa042afc3fa539e1dbf683d678 Mon Sep 17 00:00:00 2001 From: Nick Date: Wed, 21 Sep 2022 17:36:54 -0400 Subject: [PATCH 1/2] Redirect all news/events pages on galaxyproject.eu to .org. --- templates/nginx/galaxyproject.j2 | 63 ++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/templates/nginx/galaxyproject.j2 b/templates/nginx/galaxyproject.j2 index edf05a9b6..7c32ca893 100644 --- a/templates/nginx/galaxyproject.j2 +++ b/templates/nginx/galaxyproject.j2 @@ -4,7 +4,70 @@ server { server_name galaxyproject.eu; + # Redirect homepages. + location = / { + return 301 https://galaxyproject.org/eu/; + } + location = /freiburg/ { + return 301 https://galaxyproject.org/freiburg/; + } + location = /erasmusmc/ { + return 301 https://galaxyproject.org/erasmusmc/; + } + location = /belgium/ { + return 301 https://galaxyproject.org/belgium/; + } + location = /pasteur/ { + return 301 https://galaxyproject.org/pasteur/; + } + location = /genouest/ { + return 301 https://galaxyproject.org/genouest/; + } + location = /elixir-it/ { + return 301 https://galaxyproject.org/elixir-it/; + } + location = /ifb/ { + return 301 https://galaxyproject.org/ifb/; + } + + # EU-wide news/events feeds. + location ~ ^/news(\.html)?$ { + return 301 https://galaxyproject.org/eu/news/; + } + location ~ ^/events(\.html)?$ { + return 301 https://galaxyproject.org/eu/events/; + } + + # Misc. + location = /widgets/news.html { + return 301 https://galaxyproject.org/bare/eu/latest/news/; + } + location = /widgets/events.html { + return 301 https://galaxyproject.org/bare/eu/latest/events/; + } + location = /galaxy/news.html { + return 301 https://galaxyproject.org/bare/eu/news/; + } + location = /galaxy/events.html { + return 301 https://galaxyproject.org/bare/eu/events/; + } + + # Galaxy server middle pane homepages. + location = /galaxy/ { + return 301 https://galaxyproject.org/bare/eu/usegalaxy/main/; + } + location = /index-metabolomics.html { + return 301 https://galaxyproject.org/bare/eu/usegalaxy/metabolomics/; + } + location = /index-proteomics.html { + return 301 https://galaxyproject.org/bare/eu/usegalaxy/proteomics/; + } + location / { + # Subsite-specific news and events pages. + rewrite ^/([^/]+)/(news|events)(\.html)?$ https://galaxyproject.org/$1/$2/ permanent; + + # The rest should be transparently proxied to github.io. proxy_pass https://usegalaxy-eu.github.io/; proxy_cache STATIC; proxy_cache_valid 200 5m; From ecd843defa335e68381b96953da733ef39da06b2 Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 31 Oct 2022 21:19:06 -0400 Subject: [PATCH 2/2] Redirect everything not sent to galaxyproject.org to github.io. --- templates/nginx/galaxyproject.j2 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/templates/nginx/galaxyproject.j2 b/templates/nginx/galaxyproject.j2 index 7c32ca893..d170ea1a4 100644 --- a/templates/nginx/galaxyproject.j2 +++ b/templates/nginx/galaxyproject.j2 @@ -38,7 +38,7 @@ server { return 301 https://galaxyproject.org/eu/events/; } - # Misc. + # Redirect other pages used by Galaxy servers to .org location = /widgets/news.html { return 301 https://galaxyproject.org/bare/eu/latest/news/; } @@ -67,10 +67,7 @@ server { # Subsite-specific news and events pages. rewrite ^/([^/]+)/(news|events)(\.html)?$ https://galaxyproject.org/$1/$2/ permanent; - # The rest should be transparently proxied to github.io. - proxy_pass https://usegalaxy-eu.github.io/; - proxy_cache STATIC; - proxy_cache_valid 200 5m; - proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504; + # The rest should continue to be served by the European website, but under the github.io domain. + return 301 https://usegalaxy-eu.github.io$request_uri; } }