From a7d3ac95aab831b7a7bcdba5c58d9d2ef6c9d8ff Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 10 Dec 2023 15:44:57 +0000 Subject: [PATCH] nginx: uninsane.org: redirect common feed URIs to the canonical feed --- hosts/by-name/servo/services/nginx.nix | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hosts/by-name/servo/services/nginx.nix b/hosts/by-name/servo/services/nginx.nix index 8c11c856..2efe6bda 100644 --- a/hosts/by-name/servo/services/nginx.nix +++ b/hosts/by-name/servo/services/nginx.nix @@ -120,6 +120,19 @@ in # proxyPass = "http://127.0.0.1:4000"; # extraConfig = pleromaExtraConfig; # }; + + # redirect common feed URIs to the canonical feed + locations."= /atom".extraConfig = "return 301 /atom.xml;"; + locations."= /feed".extraConfig = "return 301 /atom.xml;"; + locations."= /feed.xml".extraConfig = "return 301 /atom.xml;"; + locations."= /rss".extraConfig = "return 301 /atom.xml;"; + locations."= /rss.xml".extraConfig = "return 301 /atom.xml;"; + locations."= /blog/atom".extraConfig = "return 301 /atom.xml;"; + locations."= /blog/atom.xml".extraConfig = "return 301 /atom.xml;"; + locations."= /blog/feed".extraConfig = "return 301 /atom.xml;"; + locations."= /blog/feed.xml".extraConfig = "return 301 /atom.xml;"; + locations."= /blog/rss".extraConfig = "return 301 /atom.xml;"; + locations."= /blog/rss.xml".extraConfig = "return 301 /atom.xml;"; }; @@ -147,7 +160,6 @@ in security.acme.defaults.email = "admin.acme@uninsane.org"; sane.persist.sys.byStore.plaintext = [ - # TODO: mode? { user = "acme"; group = "acme"; path = "/var/lib/acme"; } { user = "colin"; group = "users"; path = "/var/www/sites"; } ];