mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-18 08:59:42 +00:00
nixos/dokuwiki: fix https redirect
Even if the webserver had https disabled, the user would still get redirected to an https url when attemting to login.
This commit is contained in:
parent
9dab2f2de2
commit
f7b6bfd113
|
@ -321,7 +321,7 @@ in
|
||||||
enable = true;
|
enable = true;
|
||||||
virtualHosts = mapAttrs (hostName: cfg: mkMerge [ cfg.nginx {
|
virtualHosts = mapAttrs (hostName: cfg: mkMerge [ cfg.nginx {
|
||||||
root = mkForce "${pkg hostName cfg}/share/dokuwiki";
|
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)" = {
|
locations."~ /(conf/|bin/|inc/|install.php)" = {
|
||||||
extraConfig = "deny all;";
|
extraConfig = "deny all;";
|
||||||
|
@ -359,7 +359,7 @@ in
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_param REDIRECT_STATUS 200;
|
fastcgi_param REDIRECT_STATUS 200;
|
||||||
fastcgi_pass unix:${config.services.phpfpm.pools."dokuwiki-${hostName}".socket};
|
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;
|
}]) eachSite;
|
||||||
|
|
Loading…
Reference in a new issue