From 50b3ca28394b4fc795499d35f19a07edc184cbce Mon Sep 17 00:00:00 2001 From: BBaoVanC Date: Sun, 15 Aug 2021 13:38:54 -0500 Subject: [PATCH] Revert "Remove matrix well-known from matrix.boba.best" This reverts commit ce88e1779d3b6a425f527e24de4b4c190f953c53. Maybe it's better to have it on both domains, just in case. --- Caddyfile | 18 ++++++++++++++++++ conf.d/boba.best | 16 +--------------- conf.d/matrix.boba.best | 2 ++ 3 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Caddyfile b/Caddyfile index 4793065..b0773fc 100644 --- a/Caddyfile +++ b/Caddyfile @@ -23,4 +23,22 @@ } } +(matrix-well-known) { + handle /.well-known/matrix/* { + header Access-Control-Allow-Origin "*" + header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" + header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization" + header Content-Type "application/json" + + respond /.well-known/matrix/client 200 { + body `{"m.homeserver": {"base_url": "https://matrix.boba.best"}}` + close + } + respond /.well-known/matrix/server 200 { + body `{"m.server": "matrix.boba.best:443"}` + close + } + } +} + import conf.d/* diff --git a/conf.d/boba.best b/conf.d/boba.best index cf4e8c6..e77cb39 100644 --- a/conf.d/boba.best +++ b/conf.d/boba.best @@ -4,21 +4,7 @@ www.boba.best { redir https://boba.best{uri} } boba.best { - handle /.well-known/matrix/* { - header Access-Control-Allow-Origin "*" - header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS" - header Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept, Authorization" - header Content-Type "application/json" - - respond /.well-known/matrix/client 200 { - body `{"m.homeserver": {"base_url": "https://matrix.boba.best"}}` - close - } - respond /.well-known/matrix/server 200 { - body `{"m.server": "matrix.boba.best:443"}` - close - } - } + import matrix-well-known header Access-Control-Allow-Origin * root * /var/www/boba.best/public diff --git a/conf.d/matrix.boba.best b/conf.d/matrix.boba.best index 0832d53..0d83d3e 100644 --- a/conf.d/matrix.boba.best +++ b/conf.d/matrix.boba.best @@ -3,6 +3,8 @@ matrix.boba.best { encode zstd gzip + import matrix-well-known + redir /admin /admin/ handle_path /admin/* {