diff --git a/nixos/linux.nix b/nixos/linux.nix index 48a0e57..272eca4 100644 --- a/nixos/linux.nix +++ b/nixos/linux.nix @@ -298,7 +298,7 @@ in { "hyper-quineglobal-com" = { autoStart = true; - image = "forge.quinefoundation.com/ironmagma/hyper-quineglobal-com@sha256:9ef23700fee446ca8fc8667cb9c9d8f34788bc97658f2b45c2eb4d61c932d0b5"; + image = "forge.quinefoundation.com/ironmagma/hyper-quineglobal-com@sha256:d02a47ac19c84b8bd98c66924fc314ed81be77980b6e4dc18438d00c8d578232"; volumes = []; environment = {}; ports = ["3013:8081"]; @@ -379,6 +379,7 @@ in { "acme-selfsigned-forge.quinefoundation.com.service" "acme-selfsigned-hyper.quineglobal.com.service" "acme-selfsigned-pdxdestiny.com.service" + "acme-selfsigned-www.pdxdestiny.com.service" "acme-selfsigned-philippeterson.com.service" "acme-selfsigned-riverside.coldairnetworks.com.service" "acme-selfsigned-vnc.quinefoundation.com.service" diff --git a/nixos/nginx.nix b/nixos/nginx.nix index 5d7789c..84515f6 100644 --- a/nixos/nginx.nix +++ b/nixos/nginx.nix @@ -13,6 +13,19 @@ cp ${./pdxdestiny/index.html} $out/index.html cp ${pkgs.copyPathToStore ./pdxdestiny/gold.jpg} $out/gold.jpg ''; + withWww = domain: config: { + "${domain}" = config; + "www.${domain}" = { + enableACME = true; + addSSL = config.addSSL or true; + forceSSL = config.forceSSL or false; + locations."/" = { + extraConfig = '' + return 301 https://${domain}$request_uri; + ''; + }; + }; + }; in { "_default" = { @@ -27,12 +40,6 @@ ''; }; - "pdxdestiny.com" = { - enableACME = true; - forceSSL = false; - addSSL = true; - root = pdxDestinyRoot; - }; "fbksdigital.com" = { enableACME = true; # Enable Let's Encrypt certificate for HTTPS @@ -259,7 +266,12 @@ ''; }; }; - }; + } // (withWww "pdxdestiny.com" { + enableACME = true; + forceSSL = false; + addSSL = true; + root = pdxDestinyRoot; + }); # Optionally configure additional options recommendedGzipSettings = true;