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