blob: 7195f0af544011a620d9ed7e0c1fa8e2d650ce05 (
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
33
34
35
36
37
38
|
{ lib, ... }:
let
inherit (lib) head tail;
redirectDomains = [
"spectrum-os.com"
"spectrumos.org"
"www.spectrum-os.com"
"www.spectrum-os.org"
"www.spectrumos.org"
];
in
{
services.nginx.virtualHosts."spectrum-redirects" = {
serverName = head redirectDomains;
serverAliases = tail redirectDomains;
addSSL = true;
useACMEHost = "spectrum-os.org";
globalRedirect = "spectrum-os.org";
};
services.nginx.virtualHosts."spectrum-os.org".locations."= /doc".return =
"301 /doc/";
services.nginx.virtualHosts."spectrum-os.org".locations."/doc/".alias =
"/home/spectrum/Documentation/";
# TODO: some sort of robots.txt generation module might be nice.
services.nginx.virtualHosts."spectrum-os.org".locations."= /robots.txt" = {
alias = ./robots.txt;
};
security.acme.certs."spectrum-os.org".extraDomainNames = redirectDomains;
# The Spectrum website lives in /home/spectrum/www
systemd.services.nginx.serviceConfig.ProtectHome = false;
}
|