-
Notifications
You must be signed in to change notification settings - Fork 0
/
caddy.nix
49 lines (45 loc) · 1.38 KB
/
caddy.nix
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
{ services, ... }:
{
services.caddy.enable = true;
services.caddy = {
virtualHosts."domain.tld".extraConfig = ''
encode zstd gzip
header {
# disable FLoC tracking
Permissions-Policy interest-cohort=()
# Enable HTTP Strict Transport Security (HSTS)
Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"
# Enable cross-site filter (XSS) and tell browser to block detected attacks
X-XSS-Protection "1; mode=block"
# Disallow the site to be rendered within a frame (clickjacking protection)
X-Frame-Options "SAMEORIGIN"
# Avoid MIME type sniffing
X-Content-Type-Options "nosniff"
# Mitigate the risk of leaking data cross-origins
Referrer-Policy "strict-origin-when-cross-origin"
# Prevent search engines from indexing (optional)
X-Robots-Tag "none"
# Remove the server name
-Server
}
# Send it to the backend
route /* {
reverse_proxy http://localhost:30000 {
transport http {
keepalive 10s
}
# Set ip for logs
header_up X-Real-IP {remote_host}
}
}
route /livekit* {
uri strip_prefix /livekit
reverse_proxy http://localhost:7880 {
transport http {
keepalive 10s
}
}
}
'';
};
}