caddy support multi domain
This commit is contained in:
parent
f15e521895
commit
fdcc829acf
13 changed files with 344 additions and 141 deletions
|
|
@ -26,6 +26,14 @@ in
|
|||
'';
|
||||
};
|
||||
|
||||
subdomain = lib.mkOption {
|
||||
default = "prometheus";
|
||||
type = lib.types.str;
|
||||
description = ''
|
||||
The subdomain where Prometheus is reachable
|
||||
'';
|
||||
};
|
||||
|
||||
host = lib.mkOption {
|
||||
default = "localhost";
|
||||
type = lib.types.str;
|
||||
|
|
@ -94,9 +102,9 @@ in
|
|||
|
||||
(lib.mkIf cfg.proxy.enable {
|
||||
services.caddy = with cfg.proxy; {
|
||||
virtualHosts."prometheus.${domain}".extraConfig = ''
|
||||
virtualHosts."${subdomain}.${domain}".extraConfig = ''
|
||||
reverse_proxy http://${host}:9090
|
||||
import cloudflare
|
||||
import cloudflare_${domain}
|
||||
'';
|
||||
};
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue