diff --git a/hosts/unstable/linode/matrix.nix b/hosts/unstable/linode/matrix.nix index ff70d08..f7b603c 100644 --- a/hosts/unstable/linode/matrix.nix +++ b/hosts/unstable/linode/matrix.nix @@ -2,12 +2,24 @@ # them by the following commands: # nix run nixpkgs.matrix-synapse # register_new_matrix_user -k "B9EoPr2WV9hzwc7uL2Sx1JmvCeKDEOGCpB0uginQcQtEH4wzRtkSIdo7lltrjSQa" http://localhost:8448 -{ config, lib, ... }: +{ config, ... }: let domain = "${config.networking.domain}"; fqdn = "matrix.${domain}"; in { + greg.proxies."${fqdn}" = { + extraConfig = '' + error_log /var/log/nginx/debug.log debug; + proxy_ssl_verify off; + proxy_ssl_server_name on; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header X-Forwarded-Ssl on; + ''; + genAliases = false; + ssl = true; + target = "https://matrix.shire-zebra.ts.net"; + }; services.nginx = { virtualHosts = { # Server the '.well-known' files to find the Matrix API server @@ -44,36 +56,6 @@ in return 200 '${builtins.toJSON client}'; ''; }; - - # Reverse proxy in front of the actual Matrix server - "${fqdn}" = { - enableACME = true; - forceSSL = true; - - extraConfig = '' - error_log /var/log/nginx/debug.log debug; - ''; - - # Not the appropriate place for the chat client - locations = - (builtins.listToAttrs ( - builtins.map - ( - val: - lib.nameValuePair "/_${val}" { - proxyPass = "https://matrix.shire-zebra.ts.net"; - } - ) - [ - "matrix" - "synapse" - "dendrite" - ] - )) - // { - "/".extraConfig = "return 404;"; - }; - }; }; }; diff --git a/hosts/unstable/linode/nginx.nix b/hosts/unstable/linode/nginx.nix index 11af23f..73a94de 100644 --- a/hosts/unstable/linode/nginx.nix +++ b/hosts/unstable/linode/nginx.nix @@ -34,10 +34,5 @@ in ssl = true; genAliases = false; }; - "doubles.thehellings.com" = { - target = "http://localhost:8081"; - ssl = true; - genAliases = false; - }; }; }