Skip to content

Commit

Permalink
nixos/dokuwiki: fix https redirect
Browse files Browse the repository at this point in the history
Even if the webserver had https disabled, the user would still get redirected to an https url when attemting to login.
  • Loading branch information
Stijn DW committed Aug 2, 2020
1 parent 9dab2f2 commit f7b6bfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixos/modules/services/web-apps/dokuwiki.nix
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ in
enable = true;
virtualHosts = mapAttrs (hostName: cfg: mkMerge [ cfg.nginx {
root = mkForce "${pkg hostName cfg}/share/dokuwiki";
extraConfig = "fastcgi_param HTTPS on;";
extraConfig = lib.optionalString (cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL || cfg.nginx.enableACME) "fastcgi_param HTTPS on;";

locations."~ /(conf/|bin/|inc/|install.php)" = {
extraConfig = "deny all;";
Expand Down Expand Up @@ -359,7 +359,7 @@ in
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass unix:${config.services.phpfpm.pools."dokuwiki-${hostName}".socket};
fastcgi_param HTTPS on;
${lib.optionalString (cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL || cfg.nginx.enableACME) "fastcgi_param HTTPS on;"}
'';
};
}]) eachSite;
Expand Down

0 comments on commit f7b6bfd

Please sign in to comment.