This repository has no description
1{
2 services.nginx = {
3 virtualHosts = {
4 "lassul.us" = {
5 locations."= /.well-known/matrix/server".extraConfig = ''
6 add_header Content-Type application/json;
7 return 200 '${
8 builtins.toJSON {
9 "m.server" = "matrix.lassul.us:443";
10 }
11 }';
12 '';
13 locations."= /.well-known/matrix/client".extraConfig = ''
14 add_header Content-Type application/json;
15 add_header Access-Control-Allow-Origin *;
16 return 200 '${
17 builtins.toJSON {
18 "m.homeserver" = {
19 "base_url" = "https://matrix.lassul.us";
20 };
21 "m.identity_server" = {
22 "base_url" = "https://vector.im";
23 };
24 }
25 }';
26 '';
27 };
28 "matrix.lassul.us" = {
29 forceSSL = true;
30 enableACME = true;
31 locations."/_matrix" = {
32 proxyPass = "http://[::1]:8008";
33 # Without this Synapse sees every client as ::1, because
34 # `x_forwarded = true` falls back to the peer address when no
35 # X-Forwarded-For arrives. rc_login.address then becomes a single
36 # global bucket: one person mistyping a password five times locks
37 # out login for everyone, bridges included.
38 recommendedProxySettings = true;
39 };
40 };
41 };
42 };
43}