From d99cbfd10d56f2ebbe65b120cc4b7c2a977d3618 Mon Sep 17 00:00:00 2001 From: Brad Holland Date: Tue, 10 May 2022 00:52:48 -0400 Subject: [PATCH] refactor location blocks --- nextcloud.subdomain.conf.sample | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/nextcloud.subdomain.conf.sample b/nextcloud.subdomain.conf.sample index cfae0e7..62aa78a 100644 --- a/nextcloud.subdomain.conf.sample +++ b/nextcloud.subdomain.conf.sample @@ -36,18 +36,11 @@ server { # The rules in this block are an adaptation of the rules # in the Nextcloud `.htaccess` that concern `/.well-known`. - location /.well-known/carddav { + location ^/.well-known/(caldav|carddav) { return 301 $scheme://$host/remote.php/dav; } - - # The rules in this block are an adaptation of the rules - # in the Nextcloud `.htaccess` that concern `/.well-known`. - location /.well-known/caldav { - return 301 $scheme://$host/remote.php/dav; - } - - # Let Nextcloud's API for `/.well-known` URIs handle all other + + # Let Nextcloud's API for `/.well-known` URIs handle these # requests by passing them to the front-end controller. - rewrite ^/.well-known/webfinger /index.php$uri redirect; - rewrite ^/.well-known/nodeinfo /index.php$uri redirect; + rewrite ^/.well-known/(webfinger|nodeinfo) /index.php$uri redirect; }