mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
caddy: Remove tls and reverse-proxy-config options for now
This commit is contained in:
parent
e46ae6297c
commit
2531d57194
1 changed files with 5 additions and 21 deletions
|
|
@ -48,13 +48,6 @@ in
|
||||||
type = lib.types.port;
|
type = lib.types.port;
|
||||||
default = null;
|
default = null;
|
||||||
};
|
};
|
||||||
tls = lib.mkEnableOption "" // {
|
|
||||||
default = true;
|
|
||||||
};
|
|
||||||
extraReverseProxyConfig = lib.mkOption {
|
|
||||||
type = lib.types.lines;
|
|
||||||
default = "";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -132,20 +125,13 @@ in
|
||||||
let
|
let
|
||||||
mkHostConfig = value: ''
|
mkHostConfig = value: ''
|
||||||
import subdomain-log ${value.domain}
|
import subdomain-log ${value.domain}
|
||||||
@${getSubdomain value.domain} host ${(lib.optionalString (!value.tls) "http://") + value.domain}
|
@${getSubdomain value.domain} host ${value.domain}
|
||||||
handle @${getSubdomain value.domain} {
|
handle @${getSubdomain value.domain} {
|
||||||
reverse_proxy localhost:${builtins.toString value.port} ${
|
reverse_proxy localhost:${builtins.toString value.port}
|
||||||
lib.optionalString (value.extraReverseProxyConfig != "") "{ ${value.extraReverseProxyConfig} }"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
(values |> lib.map (value: mkHostConfig value) |> lib.concatLines)
|
(values |> lib.map (value: mkHostConfig value) |> lib.concatLines) + "handle { respond 404 }";
|
||||||
+ ''
|
|
||||||
handle {
|
|
||||||
respond 404
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
|
|
@ -171,14 +157,12 @@ in
|
||||||
virtualHosts =
|
virtualHosts =
|
||||||
let
|
let
|
||||||
mkHostConfig = value: {
|
mkHostConfig = value: {
|
||||||
name = (lib.optionalString (!value.tls) "http://") + value.domain;
|
name = value.domain;
|
||||||
value = {
|
value = {
|
||||||
logFormat = "output file ${config.services.caddy.logDir}/${value.domain}.log { mode 640 }";
|
logFormat = "output file ${config.services.caddy.logDir}/${value.domain}.log { mode 640 }";
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
bind tailscale/${getSubdomain value.domain}
|
bind tailscale/${getSubdomain value.domain}
|
||||||
reverse_proxy localhost:${builtins.toString value.port} ${
|
reverse_proxy localhost:${builtins.toString value.port}
|
||||||
lib.optionalString (value.extraReverseProxyConfig != "") "{ ${value.extraReverseProxyConfig} }"
|
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue