Merge pull request #97666 from Ma27/nextcloud-nginx

nixos/nextcloud: fix `nginx`-config for Nextcloud 19 and older
This commit is contained in:
Maximilian Bosch 2020-10-04 13:51:52 +02:00 committed by GitHub
commit 08cc63b20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -542,6 +542,9 @@ in {
environment.systemPackages = [ occ ]; environment.systemPackages = [ occ ];
services.nginx.enable = mkDefault true; services.nginx.enable = mkDefault true;
# FIXME(ma27) make sure that the config works fine with Nextcloud 19
# *and* Nextcloud 20 as soon as it gets released.
services.nginx.virtualHosts.${cfg.hostName} = { services.nginx.virtualHosts.${cfg.hostName} = {
root = cfg.package; root = cfg.package;
locations = { locations = {
@ -555,7 +558,7 @@ in {
}; };
"/" = { "/" = {
priority = 900; priority = 900;
extraConfig = "try_files $uri $uri/ /index.php$request_uri;"; extraConfig = "rewrite ^ /index.php;";
}; };
"~ ^/store-apps" = { "~ ^/store-apps" = {
priority = 201; priority = 201;
@ -579,7 +582,7 @@ in {
"~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)".extraConfig = '' "~ ^/(?:\\.|autotest|occ|issue|indie|db_|console)".extraConfig = ''
return 404; return 404;
''; '';
"~ \\.php(?:$|/)" = { "~ ^\\/(?:index|remote|public|cron|core\\/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|oc[ms]-provider\\/.+|.+\\/richdocumentscode\\/proxy)\\.php(?:$|\\/)" = {
priority = 500; priority = 500;
extraConfig = '' extraConfig = ''
include ${config.services.nginx.package}/conf/fastcgi.conf; include ${config.services.nginx.package}/conf/fastcgi.conf;