summaryrefslogtreecommitdiff
path: root/hosts/cloud/proxy/immich.nix
blob: 93e62d23af177e8a64aaab34c0a99c05560b4d98 (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
{ ... }:
{
  services.nginx.upstreams.immich = {
    servers = {
      "10.89.88.13:2283" = { };
      "[fd31:185d:722f::13]:2283" = { };
    };
  };

  services.nginx.virtualHosts."immich.oxapentane.com" = {
    enableACME = true;
    forceSSL = true;
    locations."/" = {
      proxyPass = "http://immich";
      extraConfig = ''
        client_max_body_size 50000M;

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

        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_read_timeout 600s;
        proxy_send_timeout 600s;
        send_timeout 600s;
      '';
    };
  };
}