summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMaximilian Bosch <maximilian@mbosch.me>2021-02-24 23:01:14 +0100
committerMaximilian Bosch <maximilian@mbosch.me>2021-02-24 23:01:14 +0100
commit797721423ca052dda400c0e1b1889c15f1972f29 (patch)
tree4c6c1f446e52eac0a6efb0a1370211b964b8e67e /nixos
parentb1f65920c357b5cdde7123fabdc7a2af4d07f93e (diff)
downloadnixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.tar
nixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.tar.gz
nixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.tar.bz2
nixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.tar.lz
nixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.tar.xz
nixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.tar.zst
nixpkgs-797721423ca052dda400c0e1b1889c15f1972f29.zip
nixos/nextcloud: update nginx config
Please note that I didn't use the current nginx config from the
administration manual as this would've broken ACME challenges[1].

Also added a fix for Microsoft clients.

[1] https://github.com/nextcloud/documentation/pull/5825#issuecomment-783977761
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/web-apps/nextcloud.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix
index 5090d424c08..6497a259dba 100644
--- a/nixos/modules/services/web-apps/nextcloud.nix
+++ b/nixos/modules/services/web-apps/nextcloud.nix
@@ -612,6 +612,14 @@ in {
               access_log off;
             '';
           };
+          "= /" = {
+            priority = 100;
+            extraConfig = ''
+              if ( $http_user_agent ~ ^DavClnt ) {
+                return 302 /remote.php/webdav/$is_args$args;
+              }
+            '';
+          };
           "/" = {
             priority = 900;
             extraConfig = "rewrite ^ /index.php;";
@@ -630,6 +638,9 @@ in {
               location = /.well-known/caldav {
                 return 301 /remote.php/dav;
               }
+              location ~ ^/\.well-known/(?!acme-challenge|pki-validation) {
+                return 301 /index.php$request_uri;
+              }
               try_files $uri $uri/ =404;
             '';
           };