2023-12-15 20:55:15 +08:00
|
|
|
inputs:
|
|
|
|
{
|
|
|
|
options.nixos.services.nginx.applications.main = let inherit (inputs.lib) mkOption types; in
|
|
|
|
{
|
|
|
|
enable = mkOption { type = types.bool; default = false; };
|
|
|
|
};
|
|
|
|
config =
|
|
|
|
let
|
|
|
|
inherit (inputs.config.nixos.services.nginx.applications) main;
|
2023-12-29 20:22:21 +08:00
|
|
|
inherit (inputs.lib) mkIf;
|
|
|
|
in mkIf main.enable
|
2023-12-15 20:55:15 +08:00
|
|
|
{
|
|
|
|
nixos.services.nginx.https."chn.moe".location =
|
|
|
|
{
|
|
|
|
"/".return.return = "302 https://xn--s8w913fdga.chn.moe/@chn";
|
|
|
|
"/.well-known/matrix/server".proxy =
|
|
|
|
{
|
2023-12-20 15:14:51 +08:00
|
|
|
setHeaders.Host = "matrix.chn.moe";
|
|
|
|
upstream = "https://matrix.chn.moe";
|
2023-12-15 20:55:15 +08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|