feat: added https to website
This commit is contained in:
parent
f0a030c44a
commit
d90622efcc
2 changed files with 37 additions and 4 deletions
|
|
@ -36,9 +36,11 @@
|
||||||
settings.PasswordAuthentication = false;
|
settings.PasswordAuthentication = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Enable the volpe service
|
|
||||||
services.volpe = {
|
services.volpe = {
|
||||||
enable = true;
|
enable = true;
|
||||||
domain = "69.61.19.180";
|
domain = "blog.jan-leila.com";
|
||||||
|
extraDomains = ["volpe.jan-leila.com"];
|
||||||
|
enableACME = true;
|
||||||
|
acmeEmail = "leyla@jan-leila.com";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,21 +13,52 @@ in {
|
||||||
domain = lib.mkOption {
|
domain = lib.mkOption {
|
||||||
type = lib.types.str;
|
type = lib.types.str;
|
||||||
default = "localhost";
|
default = "localhost";
|
||||||
description = "Domain name for nginx virtual host.";
|
description = "Primary domain name for nginx virtual host.";
|
||||||
|
};
|
||||||
|
|
||||||
|
extraDomains = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.str;
|
||||||
|
default = [];
|
||||||
|
description = "Additional domain names (aliases) for the virtual host.";
|
||||||
|
};
|
||||||
|
|
||||||
|
enableACME = lib.mkOption {
|
||||||
|
type = lib.types.bool;
|
||||||
|
default = false;
|
||||||
|
description = "Whether to enable ACME (Let's Encrypt) for SSL certificates.";
|
||||||
|
};
|
||||||
|
|
||||||
|
acmeEmail = lib.mkOption {
|
||||||
|
type = lib.types.str;
|
||||||
|
default = "";
|
||||||
|
description = "Email address for ACME certificate registration.";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = lib.mkIf cfg.enable {
|
config = lib.mkIf cfg.enable {
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
recommendedTlsSettings = cfg.enableACME;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
|
||||||
virtualHosts.${cfg.domain} = {
|
virtualHosts.${cfg.domain} = {
|
||||||
root = "${pkg}";
|
root = "${pkg}";
|
||||||
|
serverAliases = cfg.extraDomains;
|
||||||
|
forceSSL = cfg.enableACME;
|
||||||
|
enableACME = cfg.enableACME;
|
||||||
locations."/" = {
|
locations."/" = {
|
||||||
tryFiles = "$uri $uri/ /index.html";
|
tryFiles = "$uri $uri/ /index.html";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
security.acme = lib.mkIf cfg.enableACME {
|
||||||
|
acceptTerms = true;
|
||||||
|
defaults.email = cfg.acmeEmail;
|
||||||
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [80 443];
|
networking.firewall.allowedTCPPorts = [80 443];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue