想到 Nick Cao 老师曾经提过, dendrite 的 homeserver 与 well-known server 不一定要在一台服务器上,于是我想到了把 dendrite 的 homeserver 搬到境内,well-known server 还是在境外,dendrite 也还是运行在境外的机器上。
To install Mastodon on mastodon.example.com in such a way it can serve @alice@example.com, set LOCAL_DOMAIN to example.com and WEB_DOMAIN to mastodon.example.com. This also requires additional configuration on the server hosting example.com to redirect or proxy requests to https://example.com/.well-known/webfinger to https://mastodon.example.com/.well-known/webfinger. For instance, with nginx, the configuration could look like the following:
location /.well-known/matrix/client { # If your sever_name here doesn't match your matrix homeserver URL # (e.g. hostname.com as server_name and matrix.hostname.com as homeserver URL) default_type application/json; add_header Access-Control-Allow-Origin '*'; return200'{ "m.homeserver": { "base_url": "https://askk.cc" } }'; }
listen [::]:443 ssl ipv6only=on; # managed by Certbot listen443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/askk.cc-0001/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/askk.cc-0001/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
} server { if ($host = askk.cc) { return301 https://$host/$request_uri; } # managed by Certbot
location /.well-known/matrix/client { # If your sever_name here doesn't match your matrix homeserver URL # (e.g. hostname.com as server_name and matrix.hostname.com as homeserver URL) default_type application/json; add_header Access-Control-Allow-Origin '*'; return200'{ "m.homeserver": { "base_url": "https://askk.cc" } }'; }