cluster/services/websites: register with consul
This commit is contained in:
parent
baf8fe481e
commit
63b9957926
1 changed files with 14 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
{ inputs, lib, pkgs, tools, ... }:
|
||||
{ config, inputs, lib, pkgs, tools, ... }:
|
||||
|
||||
let
|
||||
importWebsites = expr: import expr {
|
||||
|
@ -20,4 +20,17 @@ let
|
|||
in {
|
||||
services.nginx.virtualHosts = websites;
|
||||
security.acme.certs = lib.mapAttrs' acmeUseDNS (lib.filterAttrs isACME websites);
|
||||
|
||||
consul.services.nginx = {
|
||||
mode = "external";
|
||||
definition.service = {
|
||||
name = "static-lb";
|
||||
address = lib.toLower "${config.networking.hostName}.${config.networking.domain}";
|
||||
port = 443;
|
||||
checks = lib.singleton {
|
||||
interval = "60s";
|
||||
tcp = "127.0.0.1:80";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue