summaryrefslogtreecommitdiffstats
path: root/tv/2configs/imgur.nix
blob: 1df67f939a92938a528cb4520e39c8edc5bfd254 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
with import <stockholm/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";
  };
}