summaryrefslogtreecommitdiff
path: root/config/services/web/searx/morty/default.nix
blob: af48fda2d8a3e9b979a61ee8d8971e3dfc1c94b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{ config, lib, ... }:

let cfg = config.services.morty;
in {
  services.nginx.virtualHosts.searx.locations =
    lib.mkIf cfg.enable {
      "/morty/" = {
        proxyPass = "http://127.0.0.1:${toString cfg.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;
        '';
      };
    };

  services.morty = { enable = false; };
}