summary refs log tree commit diff
path: root/host/Rory-nginx/services/email/nginx.nix
blob: 812993a9099dc7709c636958b280257ba5df83c6 (plain) (blame)
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
{ config, ... }:
{
  services.nginx.virtualHosts = {
    "mta-sts.rory.gay" = {
      enableACME = true;
      forceSSL = true;
      locations = {
        "/.well-known/mta-sts.txt" = {
          # age 604800
          return = ''
            200 "version: STSv1
                 mode: enforce
                 max_age: 120
                 mx: mail.rory.gay
                 "'';
        };
      };
    };
    "mail.rory.gay" = {
      enableACME = true;
      forceSSL = true;
      locations = {
        "/".return = "200 'OK'";
      };
    };
    "autoconfig.rory.gay" = {
      enableACME = true;
      forceSSL = true;
      locations."/".proxyPass = "http://localhost:1323";
    };
  };
}