From 0e89b7f21001249bfd7825db02b8dd5ddf08b1c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Yule=20B=C3=A4dorf?= Date: Sun, 25 Feb 2024 16:06:29 +0100 Subject: [PATCH 1/2] nginx/miom: init miom.space website This adds an nginx configuration for https://miom.space/. MiOM is a creative collective in Cologne that frequently hosts our hakken.irl hackathons. They're already using our cloud to organize. This service is a bit more specific than most pub.solar services and falls into a similar category as the obs-portal. On the old miom website all logging was turned off, we might want to do the same thing in nginx here as well then. --- hosts/nachtigall/apps/nginx-website-miom.nix | 33 ++++++++++++++++++++ hosts/nachtigall/default.nix | 1 + 2 files changed, 34 insertions(+) create mode 100644 hosts/nachtigall/apps/nginx-website-miom.nix diff --git a/hosts/nachtigall/apps/nginx-website-miom.nix b/hosts/nachtigall/apps/nginx-website-miom.nix new file mode 100644 index 0000000..8d5fe61 --- /dev/null +++ b/hosts/nachtigall/apps/nginx-website-miom.nix @@ -0,0 +1,33 @@ +{ ... }: + +{ + systemd.tmpfiles.rules = [ + "d '/srv/www/miom.space' 0750 hakkonaut hakkonaut - -" + ]; + + services.nginx.virtualHosts = { + "www.miom.space" = { + enableACME = true; + addSSL = true; + locations."/" = { + extraConfig = '' + return 301 https://miom.space$request_uri; + ''; + }; + }; + + "miom.space" = { + default = true; + enableACME = true; + forceSSL = true; + + 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 From de045561915fd3f203c50e2433ef3d7c4c72ad02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Yule=20B=C3=A4dorf?= Date: Sun, 25 Feb 2024 16:44:01 +0100 Subject: [PATCH 2/2] nginx/miom: disable logging --- hosts/nachtigall/apps/nginx-website-miom.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hosts/nachtigall/apps/nginx-website-miom.nix b/hosts/nachtigall/apps/nginx-website-miom.nix index 8d5fe61..126886d 100644 --- a/hosts/nachtigall/apps/nginx-website-miom.nix +++ b/hosts/nachtigall/apps/nginx-website-miom.nix @@ -9,6 +9,12 @@ "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; @@ -21,6 +27,11 @@ enableACME = true; forceSSL = true; + extraConfig = '' + error_log /dev/null; + access_log /dev/null; + ''; + locations = { "/" = { root = "/srv/www/miom.space";