blob: c0a70be26c524dbb7ea82023b6f15ebf4139651e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
{ config, lib, pkgs, ... }:
let
cfg = {
searx = config.services.searx;
filtron = config.services.filtron;
};
in {
imports = [ ./searx ./filtron ./morty ];
services.nginx.virtualHosts.searx =
lib.mkIf (cfg.searx.enable && cfg.filtron.enable) {
serverName = "searx.${config.networking.domain}";
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}/share/static/";
};
forceSSL = true;
enableACME = true;
};
}
|