-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCaddyfile
46 lines (44 loc) · 1.25 KB
/
Caddyfile
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
{
# ZeroSSL account
acme_ca https://acme.zerossl.com/v2/DV90
email YOUR_EMAIL
}
# Dashboard
https://dashboard.HEADSCALE_BASE_DOMAIN {
header {
Access-Control-Allow-Origin https://dashboard.HEADSCALE_BASE_DOMAIN
Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
Access-Control-Allow-Headers *
Strict-Transport-Security "max-age=31536000;"
X-XSS-Protection "1; mode=block"
X-Frame-Options "SAMEORIGIN"
X-Robots-Tag "none"
-Server
}
reverse_proxy http://headscale-ui
}
# API
https://api.HEADSCALE_BASE_DOMAIN {
@hs-options {
host api.HEADSCALE_BASE_DOMAIN
method OPTIONS
}
@hs-other {
host api.HEADSCALE_BASE_DOMAIN
}
handle @hs-options {
header {
Access-Control-Allow-Origin https://dashboard.HEADSCALE_BASE_DOMAIN
Access-Control-Allow-Headers *
Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
}
respond 204
}
handle @hs-other {
reverse_proxy http://headscale:8080 {
header_down Access-Control-Allow-Origin https://dashboard.HEADSCALE_BASE_DOMAIN
header_down Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE"
header_down Access-Control-Allow-Headers *
}
}
}