blob: b2b15e0207bd585bb1d5cb6ff613f7ab2e8ffdf7 (
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
|
{ pkgs, ... }:
{
catbus-web-ui = pkgs.callPackage ./catbus-web-ui.nix {};
cgit = pkgs.callPackage ./cgit.nix {};
go-packages = pkgs.callPackage ./go-packages.nix {};
https = {
forceSSL = true;
enableACME = true;
};
static = root: {
locations = {
"/" = {
root = root;
extraConfig = ''
if ($request_uri ~ ^/(.*)\.html$) {
return 302 /$1;
}
if ($request_uri ~ ^/(.*)/$) {
return 302 /$1;
}
try_files $uri $uri.$extension $uri/ =404;
'';
};
};
};
proxyACME = remoteHost: {
locations = {
"/.well-known/acme-challenge/" = {
proxyPass = "http://${remoteHost}";
};
};
};
proxySocket = socketPath: {
locations = {
"/" = {
proxyPass = "http://unix:/${socketPath}";
};
};
};
}
|