diff --git a/hosts/nachtigall/apps/nginx-website-miom.nix b/hosts/nachtigall/apps/nginx-website-miom.nix new file mode 100644 index 0000000..126886d --- /dev/null +++ b/hosts/nachtigall/apps/nginx-website-miom.nix @@ -0,0 +1,44 @@ +{ ... }: + +{ + systemd.tmpfiles.rules = [ + "d '/srv/www/miom.space' 0750 hakkonaut hakkonaut - -" + ]; + + services.nginx.virtualHosts = { + "www.miom.space" = { + enableACME = true; + addSSL = true; + + extraConfig = '' + error_log /dev/null; + access_log /dev/null; + ''; + + locations."/" = { + extraConfig = '' + return 301 https://miom.space$request_uri; + ''; + }; + }; + + "miom.space" = { + default = true; + enableACME = true; + forceSSL = true; + + extraConfig = '' + error_log /dev/null; + access_log /dev/null; + ''; + + locations = { + "/" = { + root = "/srv/www/miom.space"; + index = "index.html"; + tryFiles = "$uri $uri/ =404"; + }; + }; + }; + }; +} diff --git a/hosts/nachtigall/default.nix b/hosts/nachtigall/default.nix index ea60a16..15f50a0 100644 --- a/hosts/nachtigall/default.nix +++ b/hosts/nachtigall/default.nix @@ -23,6 +23,7 @@ ./apps/nginx-mastodon-files.nix ./apps/nginx-prometheus-exporters.nix ./apps/nginx-website.nix + ./apps/nginx-website-miom.nix ./apps/opensearch.nix ./apps/owncast.nix ./apps/postgresql.nix