From 098da93e5deb2fc0043e15f3817191f5bd668e34 Mon Sep 17 00:00:00 2001 From: Quentin Aristote Date: Sat, 14 Aug 2021 19:33:50 +0200 Subject: restructure project --- config/services/web/searx/default.nix | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 config/services/web/searx/default.nix (limited to 'config/services/web/searx/default.nix') diff --git a/config/services/web/searx/default.nix b/config/services/web/searx/default.nix new file mode 100644 index 0000000..7c5e593 --- /dev/null +++ b/config/services/web/searx/default.nix @@ -0,0 +1,32 @@ +{ config, lib, ... }: + +let + cfg = { + searx = config.services.searx; + filtron = config.services.filtron; + }; +in { + imports = [ ./searx ./filtron ./morty ]; + + services.nginx.virtualHosts."searx.aristote.fr" = + lib.mkIf (cfg.searx.enable && cfg.filtron.enable) { + locations = { + "/" = { + proxyPass = "http://${cfg.filtron.listen.address}:${ + toString cfg.filtron.listen.port + }"; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header Connection $http_connection; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + # proxy_set_header X-Script-Name /; + ''; + }; + "/static".alias = "${pkgs.searx}/sjare/static"; + }; + forceSSL = true; + enableACME = true; + }; +} -- cgit v1.2.3