From 67c36a4cfd4fb73e5a2a64881023e19fca96360a Mon Sep 17 00:00:00 2001 From: stubbfel Date: Sun, 27 Oct 2019 17:06:20 +0100 Subject: [PATCH] Revert "Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix" This reverts commit e9af41cf546c40d23e97f165eb15187adce464b0, reversing changes made to 2d0786d5586b80e85331ea7d499b540a3a3d28c4. --- services/nextcloud.nix | 89 ++++++++++++++++-------------------------- 1 file changed, 34 insertions(+), 55 deletions(-) diff --git a/services/nextcloud.nix b/services/nextcloud.nix index f0b510f..6a1d86b 100644 --- a/services/nextcloud.nix +++ b/services/nextcloud.nix @@ -30,58 +30,41 @@ ''; locations = { - "= /robots.txt" = { - priority = 100; - extraConfig = '' - allow all; - log_not_found off; - access_log off; - ''; - }; - "/" = { - priority = 200; - extraConfig = "rewrite ^ /index.php$uri;"; - }; - "~ ^/store-apps" = { - priority = 201; - extraConfig = "root ${cfg.home};"; - }; - "= /.well-known/carddav" = { - priority = 210; - extraConfig = "return 301 $scheme://$host/remote.php/dav;"; - }; - "= /.well-known/caldav" = { - priority = 210; - extraConfig = "return 301 $scheme://$host/remote.php/dav;"; - }; - "~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/" = { - priority = 300; - extraConfig = "deny all;"; - }; - "~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)" = { - priority = 300; - extraConfig = "deny all;"; - }; - "~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+)\\.php(?:$|/)" = { - priority = 500; - extraConfig = '' - include ${pkgs.nginxMainline}/conf/fastcgi.conf; - fastcgi_split_path_info ^(.+\.php)(/.*)$; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTPS ${if cfg.https then "on" else "off"}; - fastcgi_param modHeadersAvailable true; - fastcgi_param front_controller_active true; - fastcgi_pass unix:/run/phpfpm/nextcloud; - fastcgi_intercept_errors on; - fastcgi_request_buffering off; - fastcgi_read_timeout 120s; - ''; - }; + "/robots.txt" = { + extraConfig = "allow all;"; + }; + "/.well-known/carddav" = { + extraConfig = "return 301 $scheme://$host/remote.php/dav;"; + }; + "/.well-known/caldav" = { + extraConfig = "return 301 $scheme://$host/remote.php/dav;"; + }; + # Root + "/" = { + extraConfig = '' + rewrite ^ /index.php$uri; + ''; + }; + # PHP files + "~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\\.php(?:$|/)" = { + extraConfig = '' + fastcgi_split_path_info ^(.+\\.php)(/.*)$; + include ${pkgs.nginx}/conf/fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param PATH_INFO $fastcgi_path_info; + fastcgi_param HTTPS on; + fastcgi_param modHeadersAvailable true; + fastcgi_param front_controller_active true; + fastcgi_pass unix:/run/phpfpm/nextcloud.sock; + fastcgi_intercept_errors on; + fastcgi_request_buffering off; + ''; + }; - "~ ^/(?:updater|ocs-provider)(?:$|/)".extraConfig = '' - try_files $uri/ =404; - index index.php; - ''; + "~ ^/(?:updater|ocs-provider)(?:$|/)" = { + tryFiles = "$uri/ =404"; + index = "index.php"; + }; # CSS and JavaScript files "~* ^/(?!apps-local).*\\.(?:css|js)$" = { tryFiles = "$uri /index.php$request_uri"; @@ -128,10 +111,6 @@ "~ ^/(?:build|tests|config|lib|3rdparty|templates|data|\\.|autotest|occ|issue|indie|db_|console)" = { extraConfig = "deny all;"; }; - "~ \\.(?:png|html|ttf|ico|jpg|jpeg)$".extraConfig = '' - try_files $uri /index.php$uri$is_args$args; - access_log off; - ''; }; };