athens/modules/matrix/nginx.nix

47 lines
1.3 KiB
Nix
Raw Normal View History

2022-12-27 10:10:53 -05:00
{ pkgs, ... }:
2021-06-07 21:15:08 -04:00
{
services.nginx = {
enable = true;
virtualHosts = {
"matrix.walkah.chat" = {
forceSSL = true;
enableACME = true;
locations."/" = { proxyPass = "http://100.111.208.75:8008"; };
2021-06-07 21:15:08 -04:00
};
2023-07-09 19:58:59 -04:00
"syncv3.walkah.chat" = {
forceSSL = true;
enableACME = true;
locations."/" = { proxyPass = "http://100.111.208.75:8088"; };
};
2021-06-07 21:15:08 -04:00
"walkah.chat" = {
forceSSL = true;
enableACME = true;
locations."= /.well-known/matrix/server".extraConfig =
let server = { "m.server" = "matrix.walkah.chat:443"; };
2022-05-06 20:01:04 -04:00
in
''
2021-10-09 21:04:39 -04:00
default_type application/json;
add_header Access-Control-Allow-Origin *;
2021-06-07 21:15:08 -04:00
return 200 '${builtins.toJSON server}';
'';
2022-05-06 20:01:04 -04:00
locations."= /.well-known/matrix/client".extraConfig =
let
client = {
"m.homeserver" = { "base_url" = "https://matrix.walkah.chat"; };
2023-07-09 19:58:59 -04:00
"org.matrix.msc3575.proxy" = { "url" = "https://syncv3.walkah.chat"; };
2022-05-06 20:01:04 -04:00
};
in
''
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON client}';
'';
2021-06-07 21:15:08 -04:00
locations."/" = { root = pkgs.element-web; };
};
};
};
}