Merge branch 'master' of gitea.stubbe.rocks:nixos-config/stubbfelnix
This commit is contained in:
@@ -30,41 +30,58 @@
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
locations = {
|
locations = {
|
||||||
"/robots.txt" = {
|
"= /robots.txt" = {
|
||||||
extraConfig = "allow all;";
|
priority = 100;
|
||||||
};
|
extraConfig = ''
|
||||||
"/.well-known/carddav" = {
|
allow all;
|
||||||
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
|
log_not_found off;
|
||||||
};
|
access_log off;
|
||||||
"/.well-known/caldav" = {
|
'';
|
||||||
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
|
};
|
||||||
};
|
"/" = {
|
||||||
# Root
|
priority = 200;
|
||||||
"/" = {
|
extraConfig = "rewrite ^ /index.php$uri;";
|
||||||
extraConfig = ''
|
};
|
||||||
rewrite ^ /index.php$uri;
|
"~ ^/store-apps" = {
|
||||||
'';
|
priority = 201;
|
||||||
};
|
extraConfig = "root ${cfg.home};";
|
||||||
# PHP files
|
};
|
||||||
"~ ^/(?:index|remote|public|cron|core/ajax/update|status|ocs/v[12]|updater/.+|ocs-provider/.+|core/templates/40[34])\\.php(?:$|/)" = {
|
"= /.well-known/carddav" = {
|
||||||
extraConfig = ''
|
priority = 210;
|
||||||
fastcgi_split_path_info ^(.+\\.php)(/.*)$;
|
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
|
||||||
include ${pkgs.nginx}/conf/fastcgi_params;
|
};
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
"= /.well-known/caldav" = {
|
||||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
priority = 210;
|
||||||
fastcgi_param HTTPS on;
|
extraConfig = "return 301 $scheme://$host/remote.php/dav;";
|
||||||
fastcgi_param modHeadersAvailable true;
|
};
|
||||||
fastcgi_param front_controller_active true;
|
"~ ^/(?:build|tests|config|lib|3rdparty|templates|data)/" = {
|
||||||
fastcgi_pass unix:/run/phpfpm/nextcloud.sock;
|
priority = 300;
|
||||||
fastcgi_intercept_errors on;
|
extraConfig = "deny all;";
|
||||||
fastcgi_request_buffering off;
|
};
|
||||||
'';
|
"~ ^/(?:\\.|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;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
"~ ^/(?:updater|ocs-provider)(?:$|/)" = {
|
"~ ^/(?:updater|ocs-provider)(?:$|/)".extraConfig = ''
|
||||||
tryFiles = "$uri/ =404";
|
try_files $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";
|
||||||
@@ -111,6 +128,10 @@
|
|||||||
"~ ^/(?: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