From 08c7bc67bf176902da8af29353517dc64603dd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Tue, 26 Apr 2022 08:06:57 +0100 Subject: [PATCH] =?UTF-8?q?connect=20to=20mastodon=20via=20http=20i=20don?= =?UTF-8?q?=E2=80=99t=20care=20anymore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/services/mastodon.nix | 2 ++ config/services/reverse-proxy.nix | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/services/mastodon.nix b/config/services/mastodon.nix index 1da7f29c..2e45231b 100644 --- a/config/services/mastodon.nix +++ b/config/services/mastodon.nix @@ -50,6 +50,8 @@ in let mastodon = { root = "${config.services.mastodon.package}/public/"; locations."/system/".alias = "/var/lib/mastodon/public-system/"; + forceSSL = false; + enableSSL = true; locations."/" = { tryFiles = "$uri @proxy"; diff --git a/config/services/reverse-proxy.nix b/config/services/reverse-proxy.nix index 8c73c4e8..cca23beb 100644 --- a/config/services/reverse-proxy.nix +++ b/config/services/reverse-proxy.nix @@ -12,15 +12,15 @@ }; }; services.nginx.virtualHosts."mastodon.chir.rs" = { + root = "${config.services.mastodon.package}/public/"; sslCertificate = "/var/lib/acme/chir.rs/cert.pem"; sslCertificateKey = "/var/lib/acme/chir.rs/key.pem"; locations."/" = { - proxyPass = "https://mastodon.int.chir.rs"; + tryFiles = "$uri @proxy"; + }; + locations."@proxy" = { + proxyPass = "http://mastodon.int.chir.rs"; proxyWebsockets = true; - extraConfig = '' - proxy_ssl_server_name on; - proxy_ssl_name $host; - ''; }; }; }