nixos-infra/services/searxng/network.nix
Rustam Efimov 2e175cce9f
Some checks failed
Nix CI / build (push) Failing after 3m13s
fix(modules/searxng): fix bad gateway in nginx
2026-04-12 18:46:10 +03:00

26 lines
457 B
Nix

{
config,
lib,
...
}:
let
cfg = config.machine.searxng;
in
with lib;
mkIf cfg.enable {
networking.firewall = {
allowedTCPPorts = [ cfg.port ];
};
services.nginx.virtualHosts =
mkIf (cfg.domain != null) {
"${cfg.domain}" = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${toString cfg.port}";
proxyWebsockets = true;
};
};
};
}