diff options
| author | Quentin Aristote <quentin@aristote.fr> | 2021-08-14 19:33:50 +0200 |
|---|---|---|
| committer | Quentin Aristote <quentin@aristote.fr> | 2021-08-14 19:33:50 +0200 |
| commit | 098da93e5deb2fc0043e15f3817191f5bd668e34 (patch) | |
| tree | e779f777197a29a71dad5803b1d32f6302db7fb6 /config/services/web/searx/default.nix | |
| parent | b08e8f21a4da329f0507eef1781a2e6922c27dc5 (diff) | |
restructure project
Diffstat (limited to 'config/services/web/searx/default.nix')
| -rw-r--r-- | config/services/web/searx/default.nix | 32 |
1 files changed, 32 insertions, 0 deletions
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; + }; +} |
