This commit is contained in:
parent
89c1059c9a
commit
1c8bc1d422
7 changed files with 35 additions and 99 deletions
26
services/searxng/network.nix
Normal file
26
services/searxng/network.nix
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.machine.searxng;
|
||||
in
|
||||
with lib;
|
||||
mkIf enable {
|
||||
networking.firewall = {
|
||||
allowedTCPPorts = [ cfg.port ];
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts =
|
||||
mkIf (cfg.domain != null) {
|
||||
"${cfg.domain}" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://[::1]:${toString cfg.port}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue