nixos: services: matrix: add admin interface
This commit is contained in:
parent
fa7b4910f5
commit
9cadbe6256
1 changed files with 18 additions and 0 deletions
|
|
@ -10,6 +10,8 @@
|
||||||
let
|
let
|
||||||
cfg = config.my.services.matrix;
|
cfg = config.my.services.matrix;
|
||||||
|
|
||||||
|
adminPkg = pkgs.synapse-admin-etkecc;
|
||||||
|
|
||||||
domain = config.networking.domain;
|
domain = config.networking.domain;
|
||||||
matrixDomain = "matrix.${domain}";
|
matrixDomain = "matrix.${domain}";
|
||||||
|
|
||||||
|
|
@ -147,6 +149,22 @@ in
|
||||||
|
|
||||||
"/_matrix".proxyPass = "http://[::1]:${toString cfg.port}";
|
"/_matrix".proxyPass = "http://[::1]:${toString cfg.port}";
|
||||||
"/_synapse".proxyPass = "http://[::1]:${toString cfg.port}";
|
"/_synapse".proxyPass = "http://[::1]:${toString cfg.port}";
|
||||||
|
|
||||||
|
"= /admin".return = "307 /admin/";
|
||||||
|
"/admin/" = {
|
||||||
|
alias = "${adminPkg}/";
|
||||||
|
priority = 500;
|
||||||
|
tryFiles = "$uri $uri/ /index.html";
|
||||||
|
};
|
||||||
|
"~ ^/admin/.*\\.(?:css|js|jpg|jpeg|gif|png|svg|ico|woff|woff2|ttf|eot|webp)$" = {
|
||||||
|
priority = 400;
|
||||||
|
root = adminPkg;
|
||||||
|
extraConfig = ''
|
||||||
|
rewrite ^/admin/(.*)$ /$1 break;
|
||||||
|
expires 30d;
|
||||||
|
more_set_headers "Cache-Control: public";
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue