summaryrefslogtreecommitdiff
path: root/hosts/cirrus/nextcloud-proxy.nix
blob: 7a4fa67fc5680ed8d3cedd697ce772862e239486 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{ config, pkgs, ... }: {
  security.acme = {
    defaults.email = "acme@oxapentane.com";
    acceptTerms = true;
  };

  networking.firewall.allowedTCPPorts = [ 80 443 ];

  services.nginx = {
    enable = true;
    recommendedProxySettings = true;
    recommendedGzipSettings = true;
    recommendedTlsSettings = true;
    recommendedOptimisation = true;

    sslCiphers = "AES256+EECDH:AES256+EDH:!aNULL";
  };

  services.nginx.virtualHosts = {
    "nc.oxapentane.com" = {
      enableACME = true;
      forceSSL = true;
      extraConfig = ''
        client_max_body_size 512M;
      '';
      locations = {
        "/" = {
          proxyPass = "http://10.34.45.100:8080";
        };
        "/well-known/carddav" = {
          return = "301 $scheme://$host/remote.php/dav";
        };
        "/well-known/caldav" = {
          return = "301 $scheme://$host/remote.php/dav";
        };
      };
    };

    "music.oxapentane.com" = {
      enableACME = true;
      forceSSL = true;
      extraConfig = ''
        client_max_body_size 32M;
      '';
      locations = {
        "/" = {
          proxyPass = "http://10.34.45.101:4533";
        };
      };
    };
  };
}