git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #97666 from Ma27/nextcloud-nginx

nixos/nextcloud: fix `nginx`-config for Nextcloud 19 and older

commit08cc63b20b96ddc8f63f68a21e07bdf0dd77bce3 authorMaximilian Bosch <maximilian@mbosch.me> dateSun 4 Oct 2020, 13:51 (6 years ago) parentb5267968d8871c
1 file changed+5−2
nixos/modules/services/web-apps/nextcloud.nix+5−2
nixos/modules/services/web-apps/nextcloud.nix+5−2
@@ -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;