diff --git a/hosts/luna/modules/services/nginx.nix b/hosts/luna/modules/services/nginx.nix deleted file mode 100644 index 9e43bd6a..00000000 --- a/hosts/luna/modules/services/nginx.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ inputs, pkgs, ... }: -{ - services.nginx = { - enable = true; - recommendedProxySettings = true; - recommendedOptimisation = true; - recommendedGzipSettings = true; - recommendedTlsSettings = true; - }; - - security.acme = { - acceptTerms = true; - defaults.email = "price@price-hiller.com"; - }; - - networking.firewall.allowedTCPPorts = [ 80 443 ]; - services.nginx.virtualHosts = { - "price-hiller.com" = { - forceSSL = true; - enableACME = true; - root = inputs.blog.packages.${pkgs.system}.default; - locations."/".extraConfig = '' - if ($request_uri ~ ^/(.*)\.html(\?|$)) { - return 302 /$1; - } - try_files $uri $uri.html $uri/ =404; - ''; - locations."/".index = "home.html"; - }; - }; -} \ No newline at end of file diff --git a/hosts/luna/modules/services/nginx/default.nix b/hosts/luna/modules/services/nginx/default.nix new file mode 100644 index 00000000..19a21abe --- /dev/null +++ b/hosts/luna/modules/services/nginx/default.nix @@ -0,0 +1,45 @@ +{ inputs, pkgs, ... }: +{ + services.nginx = { + enable = true; + recommendedProxySettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedTlsSettings = true; + }; + + security.acme = { + acceptTerms = true; + defaults.email = "price@price-hiller.com"; + }; + + networking.firewall.allowedTCPPorts = [ + 80 + 443 + ]; + services.nginx.virtualHosts = { + "price-hiller.com" = { + forceSSL = true; + enableACME = true; + root = inputs.blog.packages.${pkgs.system}.default; + locations = { + "/" = { + extraConfig = '' + if ($request_uri ~ ^/(.*)\.html(\?|$)) { + return 302 /$1; + } + try_files $uri $uri.html $uri/ =404; + ''; + index = "home.html"; + }; + "/.well-known/openpgpkey/hu/rnmhgp3dsaq8hjgu49j8oongugr5cg4" = { + index = pkgs.writeText "pgp-pub-wkd" builtins.readFile ./public-pgp-key.asc; + extraConfig = '' + default_type application/octet-stream; + add_header Access-Control-Allow-Origin "*"; + ''; + }; + }; + }; + }; +} diff --git a/hosts/luna/modules/services/nginx/gpg-wkd/rnmhgp3dsaq8hjgu49j8oongugr5cg4j b/hosts/luna/modules/services/nginx/gpg-wkd/rnmhgp3dsaq8hjgu49j8oongugr5cg4j new file mode 100644 index 00000000..a137239c Binary files /dev/null and b/hosts/luna/modules/services/nginx/gpg-wkd/rnmhgp3dsaq8hjgu49j8oongugr5cg4j differ