athens/nix/modules/matrix/nginx.nix

62 lines
1.5 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;
2024-12-07 20:46:15 -05:00
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;
2024-12-07 20:46:15 -05:00
locations."/" = {
proxyPass = "http://100.111.208.75:8088";
};
2023-07-09 19:58:59 -04:00
};
2021-06-07 21:15:08 -04:00
"walkah.chat" = {
forceSSL = true;
enableACME = true;
2023-09-10 14:27:05 -04:00
locations = {
"= /.well-known/matrix/server".extraConfig =
2024-12-07 20:46:15 -05:00
let
server = {
"m.server" = "matrix.walkah.chat:443";
};
2023-09-10 14:27:05 -04:00
in
''
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON server}';
'';
"= /.well-known/matrix/client".extraConfig =
let
client = {
2024-12-07 20:46:15 -05:00
"m.homeserver" = {
"base_url" = "https://matrix.walkah.chat";
};
"org.matrix.msc3575.proxy" = {
"url" = "https://syncv3.walkah.chat";
};
2023-09-10 14:27:05 -04:00
};
in
''
default_type application/json;
add_header Access-Control-Allow-Origin *;
return 200 '${builtins.toJSON client}';
'';
2024-12-07 20:46:15 -05:00
"/" = {
root = pkgs.element-web;
};
2023-09-10 14:27:05 -04:00
};
2021-06-07 21:15:08 -04:00
};
};
};
}