summaryrefslogtreecommitdiff
path: root/hosts/experimental-nixos/services/nginx.nix
blob: 07a1a7cdd9b9bb1149d4e94a1f4ce48ca128c4dc (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
{
  services.nginx.enable = true;
  services.nginx.enableReload = true;

  users.users.nginx.extraGroups = ["acme"];
  services.nginx.virtualHosts."m4siri.com" = {
    http2 = true;
    addSSL = true;
    useACMEHost = "m4siri.com";
  };
  services.nginx.virtualHosts."mail.m4siri.com" = {
    http2 = true;
    addSSL = true;
    useACMEHost = "mail.m4siri.com";

    locations."/" = {
      proxyPass = "http://localhost:8080";
      proxyWebsockets = true;
    };

    locations."/.well-known/jmap" = {
      proxyPass = "https://localhost:1443";
    };

    locations."/jmap/session" = {
      proxyPass = "https://localhost:1443";
    };

    locations."/jmap" = {
      proxyPass = "http://localhost:8080";
      proxyWebsockets = true;
    };
  };
}