From 94b52615e96f68ec8b819730411e02dd54116feb Mon Sep 17 00:00:00 2001 From: niten Date: Sat, 2 Sep 2023 17:39:43 -0700 Subject: [PATCH] use fastcgiParams --- nextcloud-container.nix | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/nextcloud-container.nix b/nextcloud-container.nix index 8eff61c..8e1afca 100644 --- a/nextcloud-container.nix +++ b/nextcloud-container.nix @@ -184,25 +184,27 @@ in { "deny all;"; "~ ^/(?:.|autotest|occ|issue|indie|db_|console)".extraConfig = "deny all;"; - "~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+).php(?:$|/)".extraConfig = - '' - fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; - set $path_info $fastcgi_path_info; - try_files $fastcgi_script_name =404; - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $path_info; - # fastcgi_param HTTPS on; + "~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|oc[ms]-provider/.+).php(?:$|/)" = + { + fastcgiParams = { + SCRIPT_FILENAME = + "$document_root$fastcgi_script_name"; + PATH_INFO = "$path_info"; + modHeadersAvailable = true; + front_controller_active = true; + }; + extraConfig = '' + fastcgi_split_path_info ^(.+?\.php)(\/.*|)$; + set $path_info $fastcgi_path_info; + try_files $fastcgi_script_name =404; + include fastcgi_params; - # Avoid sending the security headers twice - fastcgi_param modHeadersAvailable true; - - # Enable pretty urls - fastcgi_param front_controller_active true; - fastcgi_pass php-handler; - fastcgi_intercept_errors on; - fastcgi_request_buffering off; - ''; + # Enable pretty urls + fastcgi_pass php-handler; + fastcgi_intercept_errors on; + fastcgi_request_buffering off; + ''; + }; "~ ^/(?:updater|oc[ms]-provider)(?:$|/)" = { index = "index.php"; tryFiles = "$uri/ =404";