summaryrefslogtreecommitdiffstats
path: root/tv/2configs/imgur.nix
blob: e22122761410896b3b8895978a306b6b644d7e7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
with import ./lib;
{ config, pkgs, ... }: {
  services.nginx.virtualHosts."ni.r" = {
    locations."/image" = {
      extraConfig = /* nginx */ ''
        client_max_body_size 20M;

        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        proxy_pass http://127.0.0.1:${toString config.krebs.htgen.imgur.port};
        proxy_pass_header Server;
      '';
    };
  };

  krebs.htgen.imgur = {
    port = 7771;
    scriptFile = "${pkgs.htgen-imgur}/bin/htgen-imgur";
  };
}