nginx: more ssl tinkering

This commit is contained in:
Zynh Ludwig 2024-12-27 20:14:55 -08:00
parent 2265f6d144
commit 250f354067
4 changed files with 41 additions and 30 deletions

View file

@ -16,7 +16,7 @@ in
# TODO: Force ssl
# addSSL = true;
serverName = "git.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "scarlet.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "permafrost";
locations."/" = {
proxyPass = "http://localhost:3032";
};

View file

@ -9,14 +9,20 @@ in
enable = lib.mkEnableOption "foundry nixos module";
};
config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable (lib.mkMerge [
{
permafrost.nginx.enable = lib.mkDefault true;
permafrost.nginx.certDomains = lib.mkIf ACMEEnabled [ "scarlet.zynh.me" ];
}
{
# permafrost.nginx.certDomains = lib.mkIf ACMEEnabled [ "scarlet.zynh.me" ];
services.nginx.virtualHosts."scarlet.zynh.me" = {
# TODO: Force ssl
# addSSL = true;
serverName = "scarlet.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "scarlet.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "permafrost";
locations."/.well-known/acme-challenge" = {
root = "/var/lib/acme/.challenges";
};
locations."/" = {
extraConfig = /* nginx */ ''
# Set proxy headers
@ -31,12 +37,16 @@ in
proxyPass = "http://localhost:30000";
};
};
}
{
permafrost.nginx.certDomains = lib.mkIf ACMEEnabled [ "ddbimporter.zynh.me" ];
services.nginx.virtualHosts."ddbimporter.zynh.me" = {
# TODO: Force ssl
# addSSL = true;
useACMEHost = lib.mkIf ACMEEnabled "permafrost";
serverName = "ddbimporter.zynh.me";
locations."/".proxyPass = "http://localhost:3232";
};
};
}
]);
}

View file

@ -28,6 +28,7 @@ in
security.acme.certs.permafrost = lib.mkIf cfg.enableACME {
email = "Zynh0722@gmail.com";
domain = "scarlet.zynh.me";
group = config.services.nginx.group;
renewInterval = "weekly";
server =
if cfg.useStagingServer

View file

@ -29,7 +29,7 @@ in
# TODO: Force ssl
# addSSL = true;
serverName = "nyazoom.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "scarlet.zynh.me";
useACMEHost = lib.mkIf ACMEEnabled "permafrost";
locations."/" = {
proxyPass = "http://localhost:3000";
extraConfig = /* nginx */ ''