feat(nixosModules/server): add nginx reverse proxy
This commit is contained in:
parent
8e12382f60
commit
4c6097903f
2 changed files with 38 additions and 1 deletions
24
modules/nixos/server/reverse-proxy/default.nix
Normal file
24
modules/nixos/server/reverse-proxy/default.nix
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.server.reverse-proxy;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
options.server.reverse-proxy = {
|
||||||
|
enable = lib.mkEnableOption "";
|
||||||
|
type = lib.pantheon.mkStrOption;
|
||||||
|
proxies = lib.mkOption {
|
||||||
|
type = lib.types.listOf lib.types.attrs;
|
||||||
|
default = [ ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf cfg.enable (
|
||||||
|
lib.mkMerge [
|
||||||
|
(lib.mkIf (cfg.type == "nginx") {
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
|
@ -36,6 +36,19 @@
|
||||||
enableSunshine = true;
|
enableSunshine = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
server.mountHelios = true;
|
server = {
|
||||||
|
mountHelios = true;
|
||||||
|
reverse-proxy = {
|
||||||
|
enable = true;
|
||||||
|
type = "nginx";
|
||||||
|
proxies = [
|
||||||
|
{
|
||||||
|
source = "chat.bwfiq.com";
|
||||||
|
target = "";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue