Revert "„services/nextcloud.nix“ ändern"
This reverts commit f6ea2148f8.
This commit is contained in:
@@ -30,58 +30,41 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
locations = {
|
locations = {
|
||||||
"= /robots.txt" = {
|
"/robots.txt" = {
|
||||||
priority = 100;
|
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 = ''
|
extraConfig = ''
|
||||||
allow all;
|
rewrite ^ /index.php$uri;
|
||||||
log_not_found off;
|
|
||||||
access_log off;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
"/" = {
|
# PHP files
|
||||||
priority = 200;
|
"~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\\.php(?:$|/)" = {
|
||||||
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 = ''
|
extraConfig = ''
|
||||||
include ${pkgs.nginxMainline}/conf/fastcgi.conf;
|
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
|
||||||
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 PATH_INFO $fastcgi_path_info;
|
||||||
fastcgi_param HTTPS ${if cfg.https then "on" else "off"};
|
fastcgi_param HTTPS on;
|
||||||
fastcgi_param modHeadersAvailable true;
|
fastcgi_param modHeadersAvailable true;
|
||||||
fastcgi_param front_controller_active true;
|
fastcgi_param front_controller_active true;
|
||||||
fastcgi_pass unix:/run/phpfpm/nextcloud;
|
fastcgi_pass unix:/run/phpfpm/nextcloud.sock;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
fastcgi_request_buffering off;
|
fastcgi_request_buffering off;
|
||||||
fastcgi_read_timeout 120s;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
"~ ^/(?:updater|ocs-provider)(?:$|/)".extraConfig = ''
|
"~ ^/(?:updater|ocs-provider)(?:$|/)" = {
|
||||||
try_files $uri/ =404;
|
tryFiles = "$uri/ =404";
|
||||||
index index.php;
|
index = "index.php";
|
||||||
'';
|
};
|
||||||
# CSS and JavaScript files
|
# CSS and JavaScript files
|
||||||
"~* ^/(?!apps-local).*\\.(?:css|js)$" = {
|
"~* ^/(?!apps-local).*\\.(?:css|js)$" = {
|
||||||
tryFiles = "$uri /index.php$request_uri";
|
tryFiles = "$uri /index.php$request_uri";
|
||||||
@@ -128,10 +111,6 @@
|
|||||||
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data|\\.|autotest|occ|issue|indie|db_|console)" = {
|
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data|\\.|autotest|occ|issue|indie|db_|console)" = {
|
||||||
extraConfig = "deny all;";
|
extraConfig = "deny all;";
|
||||||
};
|
};
|
||||||
"~ \\.(?:png|html|ttf|ico|jpg|jpeg)$".extraConfig = ''
|
|
||||||
try_files $uri /index.php$uri$is_args$args;
|
|
||||||
access_log off;
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user