1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00

nixos/dokuwiki: Don't force http with Caddy

Caddy usually expects just a hostname without scheme to do its automatic
HTTPS.  It is possible to get the old behavior (only HTTP) by setting
`services.caddy.virtualHosts.<host>.hostName`.
This commit is contained in:
Lukas Werling 2024-07-16 22:38:22 +02:00 committed by Lukas Werling
parent a5ca609b8e
commit 1475f480d5
2 changed files with 6 additions and 1 deletions

View file

@ -475,7 +475,7 @@ in
services.caddy = {
enable = true;
virtualHosts = mapAttrs' (hostName: cfg: (
nameValuePair "http://${hostName}" {
nameValuePair hostName {
extraConfig = ''
root * ${pkg hostName cfg}/share/dokuwiki
file_server

View file

@ -78,6 +78,11 @@ let
};
};
services.caddy.virtualHosts = {
"site1.local".hostName = "http://site1.local";
"site2.local".hostName = "http://site2.local";
};
networking.firewall.allowedTCPPorts = [ 80 ];
networking.hosts."127.0.0.1" = [ "site1.local" "site2.local" ];
};